Environment
SDK Detection
Section titled “SDK Detection”Android Pilot MCP searches for the Android SDK in this order:
ANDROID_HOMEenvironment variableANDROID_SDK_ROOTenvironment variable- The platform default install location, checked in an order tailored to the
current OS:
- macOS:
~/Library/Android/sdk, then~/Android/Sdk, then%LOCALAPPDATA%\Android\Sdk - Windows:
%LOCALAPPDATA%\Android\Sdk, then~/Library/Android/sdk, then~/Android/Sdk - Linux:
~/Android/Sdk, then~/Library/Android/sdk, then%LOCALAPPDATA%\Android\Sdk
- macOS:
Tool Paths
Section titled “Tool Paths”The following tools are resolved from the SDK. sdkmanager and avdmanager are looked up across the common cmdline-tools layouts (cmdline-tools/latest/bin, cmdline-tools/bin, and the legacy tools/bin), since the exact path depends on how the command-line tools package was installed.
| Tool | Path |
|---|---|
adb | $ANDROID_HOME/platform-tools/adb |
emulator | $ANDROID_HOME/emulator/emulator |
sdkmanager | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager (falls back to cmdline-tools/bin or tools/bin) |
avdmanager | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager (falls back to cmdline-tools/bin or tools/bin) |
apkanalyzer | Resolved the same way as sdkmanager/avdmanager, across the known cmdline-tools locations |
Environment Variables
Section titled “Environment Variables”| Variable | Purpose |
|---|---|
ANDROID_HOME | Primary SDK location |
ANDROID_SDK_ROOT | Fallback SDK location (deprecated) |
JAVA_HOME | JDK location for Gradle builds |
Troubleshooting
Section titled “Troubleshooting”“Android SDK not found. Set ANDROID_HOME…”
Section titled ““Android SDK not found. Set ANDROID_HOME…””None of ANDROID_HOME, ANDROID_SDK_ROOT, or the platform default paths pointed at a real directory. The server itself still starts, but every tool that touches the SDK will return this error until you set ANDROID_HOME:
export ANDROID_HOME=~/Library/Android/sdk # macOSexport ANDROID_HOME=~/Android/Sdk # Linux“adb not found”
Section titled ““adb not found””Ensure ANDROID_HOME is set and platform-tools is installed:
export ANDROID_HOME=~/Library/Android/sdk$ANDROID_HOME/platform-tools/adb version“emulator not found”
Section titled ““emulator not found””Install the emulator package:
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "emulator"Gradle build fails with “No JDK found”
Section titled “Gradle build fails with “No JDK found””Set JAVA_HOME to your JDK 17+ installation:
export JAVA_HOME=$(/usr/libexec/java_home -v 17)