Plugins/android

Android SDK Plugin

Official

avm-plugin-android • Precompiled Native Executable

Interactive Tutorial & CLI Demo

Android SDK & Emulator Plugin Walkthrough

Illustrative walkthrough: release versions, output and timings vary by platform and network. Install a JDK before setting up Android.

avm-plugin-android
Interactive CLI
Step 01 of 06:Add Plugin
Execution overhead:1.0s
# Install native Android SDK provider (cmdline-tools, platform-tools, avd manager)
$

Quick Installation

Install the precompiled standalone executable directly into ~/.avm/plugins/avm-plugin-android:

avm plugin add android
Key Commands
CommandPurposeCopy
avm plugin add androidInstall native Android SDK provider binary
avm android versionsList stable Android API levels (34, 35, 36, etc.)
avm android install 34Install Android SDK 34 + system image + tools
avm android use 34Pin Android API level for current project
avm android listShow selected and installed Android SDK versions
avm android avd create pixel-test --api 34 --device pixel_6Create an AVD in the selected SDK and install its system image if needed
avm android avd listList virtual devices
avm android avd start pixel-testLaunch the emulator; additional emulator flags are forwarded
avm android avd delete pixel-testDelete a virtual device

Environment Variable Injections

When you run an alias (e.g. avm dev) or call shims directly, the plugin exports the following environment variables:

ANDROID_HOMEAuto-injected
ANDROID_SDK_ROOTAuto-injected
PATH (adb, sdkmanager, avdmanager, emulator)Auto-injected

SDK setup and overrides

Install a JDK first, then select an installed SDK with avm android use 34. AVD commands operate on that selected SDK. Raw adb, sdkmanager, avdmanager and emulator commands are also available through shims.

ANDROID_BUILD_TOOLS_VERSION overrides the build-tools selection. ANDROID_SYSTEM_IMAGE_API selects a system-image API ID. For a custom command-line tools build, set both ANDROID_CMDLINE_TOOLS_BUILD and ANDROID_CMDLINE_TOOLS_SHA256.

AVM_ANDROID_CURL_TIMEOUT, AVM_ANDROID_UNZIP_TIMEOUT and AVM_ANDROID_SDKMANAGER_TIMEOUT are measured in seconds. Large SDK and emulator downloads may need longer timeouts.

Android components are installed and verified by sdkmanager. Their revisions are not captured by .avm.lock, so use ordinary installs for Android.

Sample Project Configuration (.avm.json)
{
  "tools": {
    "java": "17",
    "android": "34"
  },
  "aliases": {
    "build:apk": "./gradlew assembleRelease",
    "emulator:start": "emulator -avd pixel-34"
  }
}

Features & Highlights

  • Direct index querying from Google repository2-3.xml
  • Auto-installs cmdline-tools, platform-tools, build-tools, emulator, and system-images
  • Wrapper scripts for adb, sdkmanager, avdmanager, and emulator with correct ANDROID_HOME
  • Requires a working JDK; installs tools and images using sdkmanager
  • AVD device profiles select phone, TV, Wear or Automotive image tags
  • Build-tools and images resolve from available packages, which may differ from the requested API
  • Android supports unlocked installs only; frozen lockfiles are not supported