| name | android-cli-setup |
| description | Verify and bootstrap the Google Android CLI (`android` command) on the user's machine. Use when the `android` command is missing, outdated, misconfigured (wrong SDK path), or when the user wants to set up `.androidrc` or wire the CLI into agents (`android init`). Triggers include "android cli 설치", "android command not found", "android update", "sdk 경로", ".androidrc", "android init", "android cli 환경설정". Do NOT use this skill for day-to-day deploy/emulator/screen workflows — those have dedicated skills. |
android-cli-setup
Pre-flight + onboarding for the Google Android CLI. Most other skills in this repo assume android is installed and pointing at a valid SDK; this skill is the fallback that fixes those preconditions.
Configuration
Reads .claude/android-skills.json at the git repo root:
{
"androidCli": {
"sdkPath": "/Users/me/Library/Android/sdk",
"preferredAgents": ["claude-code"]
}
}
| Field | Purpose |
|---|
androidCli.sdkPath | Override Android SDK location. Used to populate --sdk in .androidrc. If absent, fall back to android info. |
androidCli.preferredAgents | Which agents android skills add should target by default. |
Pre-flight checklist
Run these in order. Stop and remediate at the first failure.
which android || command -v android
android --version
android info
Expected outputs:
- (1) a path under
/usr/local/bin/android (macOS) or similar.
- (2) something like
0.7.x. The CLI changes often — anything more than a few weeks old should be updated.
- (3) a path that exists and contains
platforms/, build-tools/, platform-tools/.
Remediation steps
Not installed
OS-specific install (per the Android CLI release page):
curl -fsSL https://dl.google.com/android/cli/latest/darwin_arm64/install.sh | bash
curl -fsSL https://dl.google.com/android/cli/latest/linux_x86_64/install.sh | bash
Windows: documented as not supported via PowerShell download. Use cmd.exe:
curl.exe -fsSL https://dl.google.com/android/cli/latest/windows_x86_64/install.cmd -o "%TEMP%\i.cmd" && "%TEMP%\i.cmd"
Re-open the shell so PATH refreshes. Verify with which android.
Outdated
android update
Encourage running this regularly — feature surface changes weekly.
SDK path wrong / not set
- Find the correct path. Common locations:
- macOS:
~/Library/Android/sdk or ~/Library/Android/Sdk
- Linux:
~/Android/Sdk
- Either:
- Override per-command:
android --sdk=/path/to/sdk <command>
- Persist via
.androidrc: see below.
- Save the resolved path to
androidCli.sdkPath in .claude/android-skills.json so other skills can read it.
.androidrc setup
Location: ~/.androidrc on macOS/Linux, %USERPROFILE%\.androidrc on Windows. One flag per line:
--sdk=/Users/me/Library/Android/sdk
Only persist flags that should apply to every invocation. Per-command flags belong on the command line.
Agent integration (android init)
Installs the official android-cli skill into detected agent skill directories. Run once per machine:
android init
If the user has multiple agents (Claude Code, Gemini, Antigravity) and only wants some, use:
android skills add --agent='claude-code' --skill=android-cli
Note: this repo's skills are richer than the official one. Recommend keeping the official skill for "what does this command do" lookups and our skills (android-deploy, android-emulator, etc.) for workflows.
Onboarding flow (run once)
If .claude/android-skills.json lacks androidCli and the user is setting up:
- Run the pre-flight checklist. Capture the SDK path from
android info.
- Ask the user a single question: "Save the resolved SDK path (
<path>) and your active agent to .claude/android-skills.json? [y/N]".
- On yes, merge:
{
"androidCli": {
"sdkPath": "<path>",
"preferredAgents": ["<active-agent>"]
}
}
- Note that the file is committable so the team shares the same baseline.
Operating rules
- Verify before suggesting. Always run
which android and android info before recommending an install — the CLI may already be set up correctly.
- Don't edit PATH manually when the official
install.sh already configures it. Use the official installers.
- Don't write
--sdk into every command. Either .androidrc or a single env-var override.
- Don't run
android update autonomously — let the user trigger updates so they don't lose work mid-task.
- Don't conflate this CLI with
sdkmanager. They overlap (android sdk install) but Android CLI is the recommended entry point.
Anti-patterns
- ❌ Setting
ANDROID_HOME / ANDROID_SDK_ROOT env vars when --sdk / .androidrc does the job per-CLI.
- ❌ Skipping the version check — old CLIs have missing subcommands and the user gets cryptic errors.
- ❌ Running
android init blindly on every machine without checking which agents are detected (it installs to all by default).
- ❌ Re-installing instead of
android update when the CLI is already present.
- ❌ Ignoring the Windows emulator known issue when planning workflows on Windows.