Complete guide to the Android CLI for developers and AI agents

  • It allows the creation, compilation, and management of Android projects through a terminal interface optimized for AI agents.
  • It integrates the Android Skills system and an updated knowledge base to automatically apply best development practices.
  • It facilitates deployment on emulators and remote access to real physical devices via Android Device Streaming.

Top view of a minimalist desktop with a laptop displaying the Android CLI terminal and a connected Android smartphone.

If you're involved in the Android development ecosystem, you know that Android Studio is the undisputed king, but sometimes it can feel like an ocean liner: powerful, yes, but slow and cumbersome. To address this, Google has released the Android CLI , a tool designed specifically for those who prefer the terminal or, even better, for those who work with AI agents and automation pipelines , making the development process much more agile and straightforward.

This interface isn't meant to replace the traditional IDE, but rather to act as a perfect complement. Imagine that scripts and AI handle the heavy lifting and repetitive work of configuration and structure, leaving you to focus on the creative aspects and final polishing in the graphical environment. It's essentially a way to standardize development for greater efficiency, especially in distributed or continuous integration environments.

Let's get started: Installation and setup

Close-up of a laptop screen with Android CLI commands and Gradle output.

To get started with the tool, the first step is to download the binary from the official Android Agents website. Once you have it on your machine, it's crucial to keep it updated, as updates are very frequent since it's still in its preliminary phase. To do this, simply run the command `android update` in your terminal.

If you're unsure whether you already have it installed, you can quickly check by running ` which android` or `command -v android` ; if the console returns a path, you're ready to begin. For AI agents to work well with the tool, it's recommended to run `android init` , which installs the basic CLI capabilities.

Advanced settings and customization

Over-the-shoulder view of a developer working with an Android command terminal on a modern monitor.

If you like to automate everything, you can create a file called .androidrc . This file allows the CLI to apply certain default options without you having to type them every time. Depending on where you are, you'll save it in ~/.androidrc (on macOS or Linux) or %USERPROFILE%\.androidrc (on Windows). For example, if you want it to always use a specific SDK, simply add the line --sdk=path-to-your-sdk.

As for general handling, there are some global options that will be a lifesaver. The -H or --help flag displays the manual for any command, while -V shows you the current version. If something goes wrong and you need to see what's happening under the hood, you can use -v, -vv, or -vvv to increase the verbosity of the output and get detailed logs of the process.

Workflow: From code to emulator

Macro detail of the USB-C connection between an Android smartphone and a laptop with the CLI in the background.

The power of this CLI lies in its ability to manage the SDK without installing the entire Android Studio package. You can download only what you need with the command `android sdk install` , specifying the platform and build-tools. This is a boon for CI runners , where disk space is at a premium.

To create a project from scratch, the `android create` command is key. You can generate an application with an empty activity using `--name` for the name and `--output` for the destination folder. The best part is that it comes with Jetpack Compose and Material 3 already configured, saving you time struggling with Gradle at the beginning.

Once you have the code, deployment is a piece of cake. First, you create the virtual device with `android emulator create` , and after compiling the APK with Gradle, you use `android run` to point to the generated file. Furthermore, a fantastic new feature is the integration with Android Device Streaming , which allows agents to remotely access real physical devices to detect specific hardware errors.

The brain of the system: Skills and Knowledge Base

Dual monitor setup displaying an AI interface and an Android CLI command terminal.

This is where things get interesting. Android Skills are Markdown instruction modules (SKILL.md files) that teach AI to perform complex tasks. There are over 20 available, ranging from auditing Play Store policy compliance to migrating legacy Leanback interfaces to Compose for TV or implementing Intent security.

You can manage these skills with commands like `android skills list` to see what's available or `android skills add` to add a specific skill to your project. On the other hand, the Android Knowledge Base (accessible via Android Docs ) solves the problem of LLMs becoming outdated, providing real-time, up-to-date documentation on Kotlin, Firebase, and the latest development guides.

Privacy and known limits

It's important to know that the tool collects some basic data, such as the commands executed and the names of the agents used (like Gemini or Claude), but it doesn't save the content of your responses or private local paths. If you prefer complete anonymity, you can add the `--no-metrics` flag when running any command.

However, it's not all perfect. Being a preliminary version, there are some shortcomings: for example, the emulator command doesn't currently work on Windows , and the CLI can't be downloaded via Windows PowerShell. This is the price to pay for using a technology that's evolving at breakneck speed.

The Android CLI positions itself as the ideal bridge between the raw power of automation and the precision of manual development, allowing AI agents to manage the project scaffolding while humans focus on quality, all supported by a modular skills system and remote access to real hardware that drastically optimizes delivery times.


Add as preferred source in Google