Android CLI: Build Android apps 3x faster using any agent
TL;DR Highlight
Google has released Android CLI and Android Skills for AI agent-based Android development, achieving a 70% reduction in LLM token usage and a 3x speed improvement in internal experiments.
Who Should Read
Developers utilizing AI agents such as Claude Code, Codex, and Gemini CLI to develop Android apps, or developers looking to set up Android build pipelines in terminal/CI environments without Android Studio.
Core Mechanics
- Google has unveiled 'Android CLI,' a collection of Android-specific CLI tools designed for use with AI agents. It's designed to work with third-party agents like Claude Code, Codex, and Gemini CLI.
- Internal experiments show that using Android CLI reduces LLM token usage by more than 70% and speeds up task completion by 3x compared to using only standard tools. This is largely due to the reduction in tokens wasted on agents exploring SDK setup or project creation.
- `android sdk install` allows selective installation of only the necessary SDK components, keeping the development environment lightweight. Creating projects with `android create` based on official templates applies recommended architectures and best practices from the start.
- `android emulator` allows you to create virtual devices and `android run` to deploy apps, making it easier for agents to automate the build-deploy cycle. You can also keep the CLI up-to-date with `android update`.
- The 'Android Skills' GitHub repository has also been released to inject Android-specific knowledge into LLMs. Skills are modular command sets in SKILL.md format, designed to be triggered automatically based on prompt content.
- Currently available Skills include Navigation 3 setup and migration, implementing edge-to-edge UI support, migrating to AGP (Android Gradle Plugin) 9, transitioning from XML to Compose, and analyzing R8 (code shrinking/obfuscation tool) settings.
- Android CLI is designed not only as a tool for agents but also for script-based workflows such as CI/CD pipelines and maintenance automation. Switching to Android Studio is also possible at any time.
Evidence
- There was a lot of agreement with a comment complaining about 'Why is a proper Android build interface coming out just to please AI chatbots?' It revealed a bitterness that something developers have been requesting for years is only being resolved because of AI agents.
- From the perspective of Apple/iOS developers, there was an opinion that 'I'm developing for macOS/iOS without Xcode and it's too difficult to keep up with the changes. I wish there was something like this for iOS.' Specific cases were also mentioned, such as the difficulty of implementing certain features like AUv3 (Audio Unit plugin format) in a terminal-based environment.
- There were complaints about the Privacy Policy clause stating that Google collects Android CLI usage data (commands, subcommands, flags). While it can be disabled with the `--no-metrics` flag, the fact that it cannot be set via an environment variable was pointed out, and there were reactions like 'Doesn't Google already have enough data?'
- There was also a cynical comment stating that even with AI and large companies with sufficient resources, they will continue to use WebView apps or cross-platform wrappers. This reflected a skeptical view of whether the decision to choose native app development will change even if the tools improve.
- While easily deploying apps is good, there was also a request to 'allow publishing apps to the Play Store without a personal ID.' This revealed that the ecosystem's barriers to entry (identity verification requirements) remain a source of dissatisfaction, as much as tool improvements.
How to Apply
- When starting a new Android project with an AI agent like Claude Code or Codex, creating a project based on an official template with the `android create` command can reduce the tokens wasted on the agent setting up the architecture and allow you to focus directly on implementing features.
- If setting up an Android build environment in a CI/CD pipeline is complex, writing a script to install only the necessary components with `android sdk install` can save time and space.
- When assigning tasks such as Navigation 3 migration or Compose transition to an agent, adding the SKILL.md file from the Android Skills repository to the project or setting it with the `android skills` command can encourage the agent to follow the latest recommended practices instead of outdated patterns.
- If you want the agent to automate UI testing as well, integrate the flow of creating a virtual device with `android emulator` and deploying with `android run` into the agent workflow to run the entire build-deploy-test cycle without human intervention.
Code Example
snippet
# Android CLI main command examples
# Install SDK components (selectively only what you need)
android sdk install
# Create a new project with the official template
android create
# Create and manage virtual devices (emulators)
android emulator
# Build the app and deploy to the device
android run
# Update the CLI to the latest version
android update
# View available Skills list and settings
android skills
# Disable usage data collection
android <command> --no-metricsTerminology
Android CLIA command-line tool that allows you to set up Android development environments, create projects, and manage devices with commands in the terminal.
SKILL.mdA markdown-formatted instruction file that AI agents refer to when performing specific tasks (e.g., Navigation migration). It is automatically loaded based on the prompt context.
AGPAbbreviation for Android Gradle Plugin. A build system plugin used when building Android apps, with frequent API changes between versions making migration cumbersome.
R8A tool for shrinking and obfuscating code when building Android apps. A successor to ProGuard, complex configurations can lead to runtime errors.
Edge-to-edgeAn Android app UI design pattern where the UI extends to the status bar or navigation bar area, using the entire screen. The default behavior has changed since Android 15 and requires adaptation.
Jetpack ComposeAndroid's modern UI framework for declaratively writing UI in Kotlin code instead of XML layouts.