| name | setup-local-tools |
| description | Use when setting up a new machine for this repo, checking whether required tools (gh, JDK, Android SDK, Firebase CLI) are installed and authenticated. Triggered by phrases like "set up my environment", "what do I need to install", "onboard me on this repo", "check my dev tools", "set up the firebase cli", "set up gh cli", "install the android sdk", "install a jdk". |
Skill: Set Up Local Tools for ApkAnalyzer + AI Agents
The recommended local setup for building this repo and letting an AI coding agent work in it at
full capability. Keep this list short — don't install things this repo already gets for free.
There's no MCP server configured here: coding agents already have shell access, and both gh and
the Firebase CLI are fully capable command-line tools on their own. Call the CLIs directly instead.
What you actually need to install
| Tool | Needed for | Check |
|---|
gh (GitHub CLI), logged in | Inspecting/diagnosing GitHub Actions runs and PRs (analyze-ci-failure skill) | gh auth status |
| JDK 25 (only if missing — see Step 1) | Gradle toolchain — jvmToolchain(25) in build-logic/convention | java -version |
| Android SDK platform 37 + build-tools (only if missing — see Step 1) | ./gradlew assembleDebug, running the app on a device/emulator | ANDROID_HOME set and %ANDROID_HOME%\platforms\android-37 (or $ANDROID_HOME/platforms/android-37) exists |
| Firebase CLI, logged in (optional) | Only if you need to query Crashlytics/Analytics/App Distribution for the apkanalyzer Firebase project from the command line — not needed to build or run the app | firebase --version / firebase login:list |
Everything else below is either already on the machine or unnecessary — don't pre-install it "just
in case."
What you likely do NOT need to install
| Thing | Why it's usually already covered |
|---|
| A standalone JDK 25 | Two independent paths usually provide it: (1) Android Studio ships a bundled JetBrains Runtime. (2) For CLI/agent builds, gradle/gradle-daemon-jvm.properties pins toolchainVersion=25 with foojay Disco API URLs, so Gradle can auto-download a matching JDK (requires the resolver plugin already applied in settings.gradle.kts). Only install one manually if the available runtime cannot start Gradle and you're not relying on Android Studio or Gradle auto-provisioning — for example, an offline machine or a standalone java requirement outside Gradle/Android Studio |
| Android SDK cmdline-tools, done manually | If Android Studio is installed (assume yes — this is an Android app), its SDK Manager already provides platform 37 + build-tools + adb. Only install manually if ANDROID_HOME is unset or missing platform 37/build-tools — e.g. a headless machine that will never run Android Studio (a CI runner, or an agent-only box) — see Step 1 |
| Node.js | Nothing in this repo needs it — no package.json anywhere, and the Firebase CLI ships as a standalone binary (see Step 2) that doesn't need Node. Only install Node if you have some other reason to |
An MCP server config (.mcp.json) | Deliberately not present. Agents can run gh ... / firebase ... directly through the shell with no extra process or duplicate interface |
Step 1 — JDK 25 and Android SDK (only if Android Studio isn't installed, or the checks fail)
Check first — don't install blindly:
java -version
echo $ANDROID_HOME
echo %ANDROID_HOME%
$env:ANDROID_HOME
ls "$ANDROID_HOME/platforms"
If Android Studio is installed and these all resolve, skip this step entirely — open Android
Studio once, let it finish its own SDK setup, and both are already handled. Only install manually
if Android Studio is absent or one of the checks above comes back empty/wrong.
Windows (PowerShell, winget)
winget install EclipseAdoptium.Temurin.25.JDK
# Android SDK: install via Android Studio's SDK Manager if at all possible — it's simpler than
# the cmdline-tools path below. Only use cmdline-tools on a machine that will never run Android
# Studio (e.g. CI, a headless agent box):
# 1. Download cmdline-tools from https://developer.android.com/studio#command-tools
# 2. Unzip to %LOCALAPPDATA%\Android\Sdk\cmdline-tools\latest
# 3. sdkmanager.bat "platform-tools" "platforms;android-37" "build-tools;37.0.0"
[System.Environment]::SetEnvironmentVariable("ANDROID_HOME", "$env:LOCALAPPDATA\Android\Sdk", "User")
macOS (Homebrew)
brew install --cask temurin@25
brew install --cask android-commandlinetools
sdkmanager "platform-tools" "platforms;android-37" "build-tools;37.0.0"
Linux (Debian/Ubuntu — adapt package manager as needed)
sudo apt update && sudo apt install -y openjdk-25-jdk
sdkmanager "platform-tools" "platforms;android-37" "build-tools;37.0.0"
Step 2 — Install gh
Windows (PowerShell, winget)
winget install GitHub.cli
gh auth login
macOS (Homebrew)
brew install gh && gh auth login
Linux (Debian/Ubuntu — adapt package manager as needed)
type -p curl >/dev/null && curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
| sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
| sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update && sudo apt install -y gh
gh auth login
gh auth login's interactive arrow-key menu needs a real TTY — if running through an agent's
non-interactive shell pass-through, use the flag form instead so it only needs one code paste in
the browser:
gh auth login --hostname github.com --git-protocol https --web
Step 3 — Install the Firebase CLI (optional, standalone binary — no Node needed)
Only do this if you actually need to query the Firebase project from the command line. Use the
standalone binary distribution, not npm install -g firebase-tools — it needs nothing else on
the machine.
Windows
winget install -e --id Google.FirebaseCLI
macOS / Linux
curl -sL firebase.tools | bash
Then authenticate (refuses to run in a non-interactive shell — run it in your own terminal, not
through an agent's shell pass-through):
firebase login
Step 4 — Verify
gh auth status
firebase --version
firebase login:list
Firebase config note
Unlike some repos, app/google-services.json is committed to this repo and required for the
:app module's Firebase plugins. It exists immediately after clone — nothing to fetch, don't delete it,
and don't regenerate it via firebase apps:sdkconfig unless intentionally repointing the app at a
different Firebase project. The Firebase CLI (Step 3) is unrelated to building the app — it's only
for ad-hoc Crashlytics/Analytics queries.
Gotchas worth knowing
| Gotcha | Why it happens |
|---|
A tool installed via winget/brew/apt mid-session isn't found (command not found / not recognized) | The shell process was started before install and cached the old PATH. Open a new terminal/session, or on Windows reload it: $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") |
./gradlew installDebug fails with INSTALL_FAILED_VERSION_DOWNGRADE | The connected device already has a release build with a higher versionCode than the debug build's versionCode = 1 (see app/build.gradle.kts). adb install -r -d only works if the existing install is itself debuggable; against a release build you must adb uninstall sk.styk.martin.apkanalyzer first (this wipes local app data — DataStore prefs, recently-viewed apps, search history) |