# /android-cli: Let the agent drive Android devices with the android CLI

Source: https://trendhub.net/skills/android-skills/android-cli
Skill folder: https://github.com/android/skills/tree/main/devtools/android-cli
Pack: Android Skills (https://trendhub.net/skills/android-skills)
Works with: Android CLI (detected agents), Claude Code, Codex

android-cli teaches the agent the android command-line tool so it can work beyond the code editor. It covers installing the CLI, managing SDK packages, creating projects from templates, inspecting a running app through JSON layout dumps and annotated screenshots, sending input with adb, searching the Android knowledge base and evaluating XML journey tests step by step with a Markdown results file.

## When to use it

- You want the agent to launch your app on an emulator and check what is on screen.
- You have written user journeys and want them evaluated on a device.
- The agent needs current Android documentation rather than its training data.

## How it works

1. **Install and set up**: If the tool is missing, the agent installs it with the platform-specific script and uses the sdk, create and emulator commands as needed.
2. **Inspect the screen**: It uses the JSON layout dump as the main view of the UI and falls back to annotated screenshots for images, web views or missing elements.
3. **Interact carefully**: Taps, swipes and text go through adb input using element coordinates, with focus checks before typing and slow scrolls.
4. **Run journeys**: Each journey action is executed exactly as written, checks only inspect the current screen, and results are written to a Markdown file.

## What it steers the agent away from

- Guessing a journey's intent instead of following each step literally.
- Typing into a field that does not have focus.
- Relying on outdated knowledge when the docs command can look things up.

## What it can touch

It runs the android CLI and adb against connected devices or emulators, can install SDK packages, and may install the CLI itself with a curl-to-shell script.

## Pairs well with

- `/android-profiler`
- `/testing-setup`

## Questions

### Is the CLI required for the other skills?

No. The other skills work without it, though the README offers the CLI as one way to install and update the whole collection.

### What if the layout dump fails?

The skill tells the agent to take an annotated screenshot and resolve numbered regions to tap coordinates.
