adb-mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**An MCP server that drives Android emulators and devices over adb**
---
Boot an AVD, screenshot, read the UI hierarchy, tap/swipe/type, set a device
lock, read logcat, run Gradle builds and tests. 79 tools,
from Claude Code, Cursor, VS Code, or any MCP client over stdio.
It is the Android counterpart to XcodeBuildMCP,
built on the official Go MCP SDK.
describe_ui → tap_on_text → screenshot, driven live against a real emulator (emulator-5556), showing the actual tool calls and their actual output.
> Android is a trademark of Google LLC. adb-mcp is an independent, unofficial
> tool built for Android and is not affiliated with, sponsored, or endorsed by Google.
> The Android robot above is reproduced/modified from work created and shared by
> Google and used according to terms described in the
> Creative Commons 3.0 Attribution License.
Why
Driving Android by hand means a long runbook of raw adb commands, and it is
easy to get wrong (stale tap coordinates, CRLF-corrupted screenshots, forgetting
exec-out, guessing coordinates off a downscaled image). This server bakes
that knowledge into its tools, so the agent doesn't have to relearn it:
- Screenshots use exec-out screencap (no CRLF corruption) and are auto-downscaled
so the image reader accepts them.
- describe_ui returns each element's **center in true device pixels** (so taps
land where you mean them to, no guessing off the image) and retries the
transient "could not get idle state" failure on its own.
The workflow itself ships as readable **resources** the agent can pull up
mid-task (the observe→act loop, native PIN/lock handling, crash triage, see
below) instead of relearning them each session.
Getting started
1. Prerequisites
- Android SDK with platform-tools (adb) and emulator. The server finds it
via $ANDROID_HOME / $ANDROID_SDK_ROOT, else the platform default
(~/Library/Android/sdk on macOS). If your MCP client launches the server
without those set, pass --sdk /path/to/sdk in the client config's args
(the server then exports it, so Gradle finds the SDK too). doctor prints
the location it resolved.
- At least one AVD (create one in Android Studio's Device Manager).
Go is **not** required: releases ship prebuilt binaries, and it's only needed to
build from source.
2. Install
On macOS/Linux:
The script (install.sh) picks the right archive for your
OS/architecture, verifies its SHA-256 against the release's checksums.txt,
and installs to ~/.local/bin (override with BIN_DIR=...; pin a version
with VERSION=v0.17.0).
Prefer to grab the binary yourself? Every platform's archive (macOS, Linux,
and Windows, amd64 and arm64) is on the
Releases page, each with a
checksum in checksums.txt. On Windows, download the windows_amd64 or
windows_arm64 zip and put adb-mcp.exe somewhere on your PATH.
Once installed, stay current with the built-in updater. It fetches the latest
release, verifies its checksum, and swaps the binary in place:
The registration below launches the server by the bare name adb-mcp, so it
must be on your $PATH (which adb-mcp should resolve; the installer warns
if ~/.local/bin isn't on it). Otherwise point the client at the absolute
path to the binary instead.
3. Register with your MCP client
**Claude Code:**
(When working inside this repo itself, the bundled .mcp.json is picked up
automatically, no registration needed.)
Or install as a **plugin**, which registers the server and adds a skill per
driving guide:
For Codex, the same plugin ships in Codex's manifest shape:
Either way adb-mcp still has to be on your PATH from step 2 - the plugin