sanuu7/androidharness/android-build
Claude Code and agent skill by sanuu7/androidharness
- community
Checking that the SKILL.md file is still in the repository.
Set up, build, sign, install and debug Android apps on this phone.
Install
npx vskill@latest install sanuu7/androidharness/android-buildSKILL.md
Android build (on this phone)
Build real APKs without a PC. Install the tools once with one approval card, build, then install and test. Fix the first real error. Do not clean the universe first.
When to use
- The user wants to create, build, sign, install or run an Android app
- assembleDebug or a manual build failed ("could not find", SDK, manifest, aapt2, d8, duplicate class)
- A release APK or AAB is needed for GitHub or Google Play
When not to use
- The app built and installed but crashes (android-crash)
- Only Compose UI work in an existing buildable project (android-compose)
1. Get the tools (once)
- Check what exists:
env_status, thenshell:java -version; d8 --version; aapt2 version; ls $HOME/android-sdk/platforms. If all four answer and anandroid.jaris listed for the API you need, skip to step 2. - Otherwise call
android_sdk_install. It shows one card and installs OpenJDK 21, D8, aapt2 and apksigner from the package repository, plusandroid.jarfrom Google's SDK repository. Passplatform(the project's compileSdk, default 35) andgradle=trueonly for Gradle projects. Do not install those pieces one by one withpkg_install. - If the Linux environment is not installed, say so once. The conversation offers the install action. Never tell the user to move to a PC because a tool is missing.
- Verify with the commands above. A package marker is not proof; a command that runs is.
2. Pick the route
- A, no Gradle: a plain Java and XML app, or a new app where the user does not need Kotlin, Compose or Maven libraries. Builds in seconds. Use it by default for "make me a small app".
- B, Gradle: the project has
gradlew,build.gradleorbuild.gradle.kts, or needs Kotlin, Compose, AndroidX or other dependencies. Slow and memory hungry. Readreferences/gradle-on-device.mdbefore the first build.
Route A: build without Gradle
- New project: copy the files under
templates/hello-java/withskill_view(name="android-build", file_path="templates/hello-java/<file>")andwrite_file. Savegitignore.txtas.gitignore. Rename the package in the manifest and the Java path together. Check:packagein the manifest matches the folder undersrc/. - Once per project, copy
scripts/build-apk.shthe same way into the project root. shell:sh build-apk.shfrom the project root. It runs aapt2, javac, d8, adds the dex, signs with a debug key and verifies. Check: the last lines printAPK: <path>.- On an error, read the first message only. javac gives
file:line; aapt2 names the resource or manifest line. Fix withedit_file, re-run the same command. - Limits: Java only, plain jars in
libs/are supported, AARs are not. Kotlin, Compose or AndroidX means route B.
Route B: build with Gradle
Follow references/gradle-on-device.md. In short: use ./gradlew when it exists, pass the aapt2 override on the command line, cap memory, run it with shell_background, and expect the first build to download hundreds of MB.
Install and run
- Tell the user the APK path. Copy it somewhere a file manager can reach when needed:
cp <apk> /sdcard/Download/. - Install, in this order:
- With Shizuku or root (check
env_status):pm install -r <apk>. Check: output containsSuccess. - Otherwise ask the user to open the APK from the Files screen or any file manager and tap Install. The Play Store build of AndroidHarness cannot install packages itself, a file manager can.
- Confirm before claiming it is installed:
pm list packages <package>when privileged, or the user's confirmation. - Launch with
monkey -p <package> -c android.intent.category.LAUNCHER 1(privileged), or ask the user to open it. Thenread_logcatwithpackage_nameand fix crashes with theandroid-crashskill.
Release (GitHub and Google Play)
Read references/release.md. A signed APK works for GitHub Releases. Google Play needs an AAB, which only the Gradle route produces. Never print, commit or put a release keystore or its password in the project.
Pitfalls
ANDROID_JARand$HOME/android-sdklive under the harness prefix. Do not search/sdcardfor them or invent Termux paths such as/data/data/com.termux/....- Do not download Google's build-tools zip. Its aapt2, aidl and zipalign are x86 binaries and will not run here. The aarch64
aapt2comes fromandroid_sdk_install. resources.arscmust stay stored and 4-byte aligned for targetSdk 30 and up.build-apk.shappends the dex last to keep it that way. Do not re-zip the APK withziporjar cf.- Never accept Android SDK licenses silently. Ask the user first (see the Gradle reference).
- If a basic command exits 126 or 127, run
env_statusonce and follow its diagnosis. Do not change permissions broadly or reinstall Linux as a first response. - Do not use
--offlineunless the error is clearly a network failure.
Verification
The build command prints an APK path, apksigner verify passed, and installation or launch was confirmed by a real result, not assumed.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingapp/src/main/assets/skills/android-build/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sanuu7/androidharness/android-build)