adb-mcp
adb-mcp is an MCP server that lets an agent drive Android emulators/devices over adb and run Android build/test workflows.
Manage devices/emulators: list/boot/shutdown AVDs, wait for boot, snapshots, Wi-Fi connect, adb reverse, session defaults.
Observe UI: screenshots, describe_ui hierarchy with true-pixel centers, render_stats.
Interact: tap, tap_on_text/tap_element, swipe, drag, long_press, type text, key combos, PIN entry, waits, batched run_sequence.
Test lock/security: set/clear lock, check secure state, biometric enrollment/fingerprint simulation, PIN fallback.
Control emulator hardware/network: SMS, calls, battery, cellular state/speed, sensors, GPS, rotation.
Manage apps: install/uninstall, launch/stop, app state/version/launcher activity, clear data, permissions, deep links, push/pull files.
Debug/log: logcat one-shot/streaming with filters/redaction, clear logcat, last crash, screen recording.
Diagnostics: doctor, dark mode, status bar demo mode, stay awake, mock location.
Gradle: build/install/run, background builds, unit/instrumented tests, coverage reports, task/variant/project/properties discovery, scaffold project.
React Native/Expo helpers: app_state Metro vs embedded bundle, launch_dev_client, reload_app, open_dev_menu.
Use MCP guide resources for driving, RN/Expo, PIN/lock, crash triage, build/test workflows.
Drives Android emulators and devices over adb, with tools for booting, screenshots, UI hierarchy inspection, tapping, swiping, typing, logcat, device locking, biometrics, app lifecycle, and more.
Supports Expo dev builds, launching dev clients directly to Metro (skipping the Dev Launcher) and reloading or opening the dev menu.
Runs Gradle builds and tests on Android projects, including assembleDebug, unit and instrumented tests, JaCoCo coverage reports, and task/variant/project discovery.
Integrates with Metro, the React Native bundler, via adb reverse port forwarding, bundle detection, and app reloads for quick JS development.
adb-mcp
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. 81 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-mcpis 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_uireturns 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.
Related MCP server: Playwright MCP
Getting started
Let your agent set it up
Paste this into Claude Code, Cursor, Codex or any agent that can run shell commands:
Set up adb-mcp (https://github.com/iksnerd/adb-mcp), an MCP server that drives
Android emulators and devices. Do each step and report what you did.
1. Check that `adb` and an Android SDK exist (`adb version`; the SDK is usually
at ~/Library/Android/sdk on macOS or ~/Android/Sdk on Linux). If they are
missing, tell me to install Android Studio and stop. Do not install it yourself.
2. Install the server: `curl -fsSL https://raw.githubusercontent.com/iksnerd/adb-mcp/main/install.sh | sh`
On Windows, take the zip from https://github.com/iksnerd/adb-mcp/releases/latest instead.
Then check `which adb-mcp`. If it is not on PATH, use its absolute path in step 3.
3. Register it with the client you are running in, once:
- Claude Code: `claude mcp add -s user adb -- adb-mcp` (user scope, so it works in every project)
- Cursor, Windsurf or another client: add {"mcpServers":{"adb":{"command":"adb-mcp"}}} to its MCP config
If the client launches servers without ANDROID_HOME set, add "--sdk", "<sdk path>" to args.
4. Tell me to restart the client so the adb tools load, then stop. After the
restart, call `doctor` and fix what it reports. Then call `list_avds`, boot
one with `boot_emulator`, and take a `screenshot` to prove it works.Prefer to do it yourself? The same steps, one at a time:
1. Prerequisites
Android SDK with
platform-tools(adb) andemulator. The server finds it via$ANDROID_HOME/$ANDROID_SDK_ROOT, else the platform default (~/Library/Android/sdkon macOS). If your MCP client launches the server without those set, pass--sdk /path/to/sdkin the client config'sargs(the server then exports it, so Gradle finds the SDK too).doctorprints 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:
curl -fsSL https://raw.githubusercontent.com/iksnerd/adb-mcp/main/install.sh | shThe 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.24.3).
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:
adb-mcp updateThe 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:
claude mcp add adb -- adb-mcp(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:
claude plugin marketplace add iksnerd/adb-mcp
claude plugin install adb-mcp@adb-mcpRegister the server one way, not both. claude mcp add and the plugin each
register it, under different names (adb and plugin:adb-mcp:adb), so using
both gives a session two copies of all the tools and no clear one to call. If you
added it with claude mcp add and then install the plugin, remove the first
(claude mcp remove adb).
For Codex, the same plugin ships in Codex's manifest shape:
codex plugin marketplace add iksnerd/adb-mcp
codex plugin add adb-mcp@adb-mcp-pluginsThe Claude plugin starts the server with node, which downloads the build for
your machine from the GitHub release on first run and checks it against a pinned
SHA-256, so it needs Node on your PATH but not step 2. The Codex plugin still
expects adb-mcp on your PATH from step 2. What the plugin runs and sends is
in docs/PRIVACY.md.
Cursor / VS Code: one-click install (assumes adb-mcp is on your PATH
from step 2):
Any other client (Windsurf, Codex, …): run adb-mcp over stdio.
The usual config shape:
{
"mcpServers": {
"adb": { "command": "adb-mcp" }
}
}To confirm it's wired up, ask your agent to "boot an emulator and take a screenshot".
From source (Go 1.26+)
The module pins toolchain go1.26.10; a Go 1.26 install downloads that patch
itself the first time you build.
make install # builds ./bin/adb-mcp and copies it to ~/.local/bin
# or:
go build -o bin/adb-mcp ./cmd/adb-mcp
# or straight from the module (note the /cmd/adb-mcp suffix):
go install github.com/iksnerd/adb-mcp/cmd/adb-mcp@latestTools
81 tools across ten areas. Every device-facing tool takes an optional
serial (adb -s). Omit it with one device attached, or pass one from
list_devices with several. Full reference: docs/TOOLS.md.
Emulator / device: boot, list, wait-for-boot, shut down, connect over Wi-Fi,
adb_reverseport forwarding (Metro!)Observe:
screenshotto see (works on multi-display foldables, pick a panel withdisplay),describe_uifor true-pixel element centers, with the focused top window (spot a biometric prompt, or the wrong app entirely, occluding your target via optionalpackage),filter/query/compactmodes, and a hidden-node count so absence is trustworthy;render_statscounts the real view tree and frame health, which the viewport-scopeddescribe_uicannotInteract: tap,
tap_on_text/tap_element(id-addressed), swipe, drag, long-press, type, key combos, PIN pads,wait,run_sequence(batch steps + guards in one call, which keeps native-timer flows from being perturbed by per-step round-trips); opt-inverify_changetells you whether a tap/key actually changed the UI; opt-invia_accessibilityontap_on_text/tap_element(EXPERIMENTAL) dispatches a real accessibility click for native views a coordinate tap can't reach, see bridge/README.mdLock / Keystore / Biometrics: set/clear a secure lock screen, check lock state,
has_biometric_enrolled+fingerprint_touch/finger_removeto satisfy a BiometricPrompt on the emulatorExtended Controls (emulator):
send_sms(OTP/2FA),phone_call,set_battery(also works on real devices via dumpsys),cellular(roaming/weak-signal/throttled),set_sensor(accelerometer/light/…),rotate_screen,avd_snapshot, driving the emulator's console-only panel thatdescribe_uican't seeApp lifecycle: install/uninstall, launch/stop,
get_app_details(version and launcher activity of an installed app, or of a local APK viaapk_pathwith no device),app_state(running pid(s) + Metro-vs-embedded bundle),launch_dev_client(Expo dev build → Metro, skipping the Dev Launcher),reload_app/open_dev_menu, clear data, permissions, deep links, push/pull filesLogs & capture: one-shot or streaming
logcat(substring/priority/tag filters,sincetime window, opt-inredactto mask tokens/passwords/API keys before output),clear_logcat,last_crash, screen recordingEnvironment & diagnostics: dark mode, mock location, clean status bar,
stay_awake(stop a doze-happy screen blanking your screenshots),doctorGradle build & test:
assembleDebug, unit tests, instrumented tests, JVM unit-test coverage via JaCoCo (get_coverage_report/get_file_coverage), task + variant + module discovery (list_gradle_variants/list_gradle_projects),scaffold_android_project, one-shotbuild_and_run. Builds return a compact summary (status, error count, first errors, APKs) with the full redacted log on disk, andgradle_build background=trueplusbuild_statuskeep a multi-minute build from holding the call openSession defaults: pin
project_dir/serialonce (session_set_defaults) so a multi-module/multi-flavor project or multi-device session doesn't need them repeated on every call
The driving know-how itself ships as six MCP resources (android://guide/*)
the client can list and read. See docs/TOOLS.md for the URIs,
or jump straight to android://guide/driving for the core loop below.
The core loop
observe → locate → act → re-observe. screenshot to see, describe_ui to
get true-pixel centers, tap/tap_on_text/swipe/input_text to act, then
screenshot again to confirm. Read android://guide/driving for the full loop
and the gotchas that waste turns.
Development
make check # go vet + go test + doc-count check (unit tests need no emulator)
make run # run over stdio for manual JSON-RPC pokingLayout:
cmd/adb-mcp/main.go entry: subcommands (update/version) or serve MCP over stdio
internal/tools/ thin MCP tool bindings
internal/adb/ the device layer: an adb.Client whose methods are the commands
internal/gradle/ host-side Gradle: builds (summary, log, background jobs), secret redaction, test and coverage reports
internal/uiauto/ pure uiautomator-hierarchy model + parsing (unit-tested)
internal/sdk/ resolves the Android SDK (adb/emulator paths, PATH env)
internal/concurrent/ RunAll/RunIndexed: fan out independent I/O calls, join, done
internal/guides/ the skill guides, embedded and served as MCP resources
internal/selfupdate/ the `adb-mcp update` release fetch/verify/swap
internal/bridgeupdate/ the `adb-mcp bridge install` release fetch/verify/installDependencies point inward only (tools → adb, gradle, uiauto → sdk), and each
internal/tools/<domain>.go adapter mirrors an execution file of the same
name (device commands are adb.Client methods). Full map, the package graph,
and the rules for adding a tool: ARCHITECTURE.md.
Documentation
adb-mcp.com: landing page
docs/TOOLS.md: full tool-by-tool reference and the guide resources
ARCHITECTURE.md: the mirror convention, package layout, and how to add a tool
docs/CHANGELOG.md: shipped work, newest first
docs/BACKLOG.md: open ideas and XcodeBuildMCP parity gaps
Contributing
See CONTRIBUTING.md for setup and conventions. Found a security issue? See SECURITY.md instead of opening a public issue. Licensed under MIT.
Available Tools
81 toolsadb_reverseADB reverseAIdempotent
Forward a DEVICE TCP port to a HOST port (adb reverse) so the emulator/device can reach a server on this machine — the canonical use is tcp:8081 for Metro. CRITICAL for RN/Expo dev clients: if the app can't reach its dev server it may SILENTLY fall back to the embedded bundle and ignore every code edit you make — set this up before a dev-client session, and suspect it whenever edits seem to have no effect (app_state confirms whether the running process is on Metro or the embedded bundle). remove=true undoes the forward.
Inputs: device_port (required), remove, serial, host_port.
app_stateApp stateARead-only
Report an app's RUNTIME state: installed?, running?, foreground?, top activity, pid(s), main-process uptime, install/update times, and — for React Native/Expo — whether it is serving a live METRO bundle or its baked-in EMBEDDED one. When it is on Metro it also identifies WHICH dev server: port, pid, and the project root that server is running in. That matters because "metro" does not mean the RIGHT metro — a dev server left running from another checkout still holds port 8081, so the app connects happily and runs that branch's code while this call looks healthy. Pass source_path to get an explicit stale_verdict (stale | current | undetermined) with its reason, never silence. Run this FIRST when JS edits seem to have no effect.
Inputs: package (required), serial, source_path.
avd_snapshotAVD snapshotADestructive
Manage emulator AVD snapshots (adb emu avd snapshot): action=save|load|delete a named snapshot, or list them. Save a known-good state, then load it to reset the device deterministically between runs — faster than a wipe_data cold boot. Emulator-only.
Inputs: action (required), name, serial.
boot_emulatorBoot emulatorADestructive
Boot an AVD by name and return its device serial (e.g. emulator-5554). Launches the emulator detached so it outlives this call, and waits for full boot (sys.boot_completed) by default. Use the returned serial for later tools if you boot more than one device. Booting can take 30-120s on a cold start. If an emulator of this AVD is already running it returns that serial instead of launching a second one; no_snapshot and wipe_data then error, because they cannot apply to a running emulator (stop it with shutdown_emulator first).
Inputs: avd (required), timeout_s, wipe_data, no_snapshot, +1 more.
build_and_runBuild and runADestructive
One-shot build → install → launch: runs Gradle (default task assembleDebug) in project_dir, installs the resulting APK on the device, and launches package. Equivalent to gradle_build + install_app + launch_app in a single call, and it blocks for the whole build. A failed build returns the same summary and full-log path as gradle_build. If several APKs exist under build/outputs (multi-flavor projects, leftover androidTest APKs), the newest non-test one is installed.
Inputs: package (required), args, task, serial, +1 more.
build_statusBuild statusARead-only
Report a background gradle_build (started with background=true): running with elapsed time, or the final summary (passed/failed, error count, first errors, APK paths, full-log path). Jobs live only as long as this server process. A job stopped with cancel_build reports as failed, cancelled by cancel_build.
Inputs: job_id (required).
cancel_buildCancel buildADestructive
Stop a background gradle_build by job id. Cancellation is asynchronous: build_status then reports the job as failed, with 'cancelled by cancel_build' as the reason. A job that already finished is reported as such and left alone; an unknown or evicted id is an error.
Inputs: job_id (required).
cellularCellularAIdempotent
Shape the emulated cellular radio (adb emu gsm / network): data and voice registration state (unregistered/home/roaming/searching/denied/off/on), signal strength (0-4), and mobile-data throughput/latency (network_speed like "lte"/"edge" or ":" kbps; network_delay like "umts" or ":" ms). Test offline/roaming/weak-signal and slow-network behaviour deterministically. Every field optional; set at least one. Emulator-only.
Inputs: data, voice, serial, signal, +2 more.
clear_app_dataClear app dataADestructiveIdempotent
Wipe an app's data and cache (pm clear) to reset it to a first-launch state — the fastest way to reproduce onboarding/permission flows from scratch.
Inputs: package (required), serial.
clear_device_lockClear device lockBDestructive
Remove the secure lock screen, supplying the current credential as old_value. Use to restore a clean state after testing a Keystore flow.
Inputs: old_value (required), serial.
clear_logcatClear logcatADestructiveIdempotent
Empty the device's logcat ring buffer (adb logcat -c). The sharpest isolation primitive for a press→observe loop: clear, perform ONE action, then logcat — every line you read was caused by that action. Without it, a filter hit may be minutes old and an empty result may just mean the buffer rotated. (For reaching BACK in time instead, use logcat's since param.)
Inputs: serial.
connect_wirelessConnect wirelessA
Connect to a device over Wi-Fi/TCP (adb connect), optionally pairing first (adb pair) with the 6-digit code from Android 11+ Wireless debugging. Pass host:port; for pairing also pass the pairing address + code shown on the device.
Inputs: host_port (required), pair_address, pairing_code.
describe_uiDescribe UIARead-only
Read the on-screen UI hierarchy as a list of elements, each with its text, content_desc, resource_id, class, clickable flag, pixel bounds, and a precomputed center in TRUE DEVICE PIXELS. This is your source of truth for AIMING: pass an element's center straight to tap. Never guess coordinates from the screenshot (it is downscaled and you will miss). The response header states the FOCUSED WINDOW (if it's a system overlay — biometric prompt, permission dialog — the elements belong to that overlay, not your app) and how many nodes the filter hid. Default filter keeps labelled/clickable/id-carrying elements minus redundant wrappers; filter="clickable" returns only tap targets (much smaller); filter="all" returns every bounded node — the only mode where absence proves an element isn't in the CURRENT VIEWPORT's hierarchy. Every mode is viewport-scoped: Android omits a ScrollView's off-screen children from the accessibility tree entirely, so scroll before concluding an element does not exist, and never use this to COUNT a long list (it will undercount) — render_stats reports the whole view tree. Canvas-drawn (RN/Flutter/Skia) content appears in NO mode.
Inputs: query, filter, serial, compact, +1 more.
doctorDoctorARead-only
Diagnose the local toolchain, and the first call of any session that isn't going well: Android SDK path (and whether it really is an SDK), adb/emulator availability, known AVDs, attached devices, per-device accessibility bridge status, plus the host build tools — a JDK (Gradle needs one) and a system gradle (needed only so scaffold_android_project can generate a wrapper). Run this first when something isn't working, especially a Gradle tool failing with "SDK location not found".
dragDragA
Press-hold-move-release drag from (x1,y1) to (x2,y2) in true device pixels (input draganddrop, Android 11+). Unlike swipe (which flings), this holds at the start first — use it for drag handles, long-press-to-reorder lists, and drag-and-drop targets a quick swipe skips.
Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +2 more.
enter_pinEnter PINA
Enter digits on a numeric PIN pad by tapping each key with a settle delay. Use when input_text does nothing because the pad renders its own key views. Visibility is PAD-SPECIFIC — run describe_ui on the pad screen first: a native-view pad (digits listed as Buttons with text) works with the default hierarchy lookup, no extra args. Only CANVAS-DRAWN pads (React Native / Skia SDK pads, whose keys are invisible to describe_ui) need 'grid' (the pad's bounding box; digits placed on a standard 3x4 dialpad) or 'coords' (explicit per-digit x,y) — read those bounds off a screenshot.
Inputs: digits (required), grid, coords, serial.
fingerprint_touchFingerprint touchA
Simulate a fingerprint-sensor touch on an EMULATOR (adb emu finger touch). With a fingerprint enrolled it satisfies a BiometricPrompt, so you can drive the real biometric path instead of cancelling into the PIN fallback. finger_id must match an enrolled finger (default 1). Check has_biometric_enrolled FIRST: with nothing enrolled the prompt sits on "Touch the sensor" forever. GOTCHA: it reports OK even when the id matches nothing, and wrong ids trip a HAL lockout, so enroll deterministically rather than sweeping ids (the pin-and-lock guide: a skill, or the android://guide/pin-and-lock resource). Emulator-only.
Inputs: serial, finger_id.
finger_removeFinger removeAIdempotent
Lift the simulated finger off the sensor (adb emu finger remove) — the complement to fingerprint_touch, for flows that watch for the finger-up event. Emulator-only.
Inputs: serial.
get_app_detailsGet app detailsARead-only
Report an installed app's version name/code and its launchable activity (dumpsys package + resolve-activity) — to confirm what build is installed and find the activity to launch. Pass apk_path instead of package to read a local .apk (package id, version, launcher activity) with no device attached — handy right after gradle_build.
Inputs: serial, package, apk_path.
get_coverage_reportGet coverage reportADestructive
Run a JaCoCo coverage-report Gradle task in project_dir (default 'jacocoTestReport') and summarize coverage: overall line/branch/method/class percentages plus a per-package breakdown, worst-covered first; multi-module reports are merged. 'jacocoTestReport' is NOT an Android Gradle plugin task: if it is missing, pass AGP's 'createDebugUnitTestCoverageReport' as task= (find it with list_gradle_tasks; see the build-and-test guide: a skill, or the android://guide/build-and-test resource). JVM unit tests only. Pass json=true for structured JSON.
Inputs: args, json, task, project_dir.
get_file_coverageGet file coverageADestructive
Same JaCoCo run and task fallback as get_coverage_report, scoped to one source file: the missed and partially-covered line numbers plus per-method detail. Use it after get_coverage_report names the weakest package. file matches by suffix across every module (an ambiguous name returns every match; a miss lists the files that have data). JVM unit tests only. Pass json=true for structured JSON.
Inputs: file (required), args, json, task, +1 more.
gradle_buildGradle buildADestructive
Build the app with Gradle (default task assembleDebug) in project_dir. project_dir must contain the Gradle wrapper (gradlew). Runs on the host, not a device. Returns a compact summary (status, duration, error count, first errors) and the path of the full log, with credential-shaped values redacted. It also lists the APKs under build/outputs, newest first; that can include APKs left by earlier builds. For builds that take minutes pass background=true: it returns a job id and log path at once, and build_status reports the result and cancel_build stops it.
Inputs: args, task, background, project_dir.
gradle_project_propertiesGradle project propertiesARead-only
Dump Gradle's evaluated properties for one module, such as :app or :feature:login. Use after list_gradle_projects when you need the module's namespace, Android SDK settings, build directory, or other effective configuration rather than just its task/variant names. This is the module's FULL effective property set — the same one ./gradlew properties would print, which can include credentials a build.gradle reads from ~/.gradle/gradle.properties or env (e.g. private Maven repo auth). Values for keys that look secret-shaped (password/token/key/credential) are redacted before being returned.
Inputs: module (required), project_dir.
grant_permissionGrant permissionAIdempotent
Grant a runtime permission to an app (pm grant), e.g. android.permission.CAMERA — skips the in-app permission dialog so you can drive straight to the feature.
Inputs: package (required), permission (required), serial.
has_biometric_enrolledHas biometric enrolledARead-only
Report whether any fingerprint is enrolled (and how many), from dumpsys fingerprint. Check this BEFORE a biometric flow: with nothing enrolled, fingerprint_touch can never satisfy a BiometricPrompt — it just sits on "Touch the sensor" — so branch to enrolling one or to the PIN path instead of guessing. Works on emulators and physical devices. Note: the framework exposes only an enrolled COUNT, never which finger id is enrolled, and a wrong fingerprint_touch id trips a HAL lockout after a few tries — so enroll deterministically rather than sweeping ids.
Inputs: serial.
input_key_comboInput key comboA
Press several keys together as a chord (input keycombination, Android 11+). Use preset="select_all" (or copy/paste/cut/undo/redo/save/find) for a named shortcut, or keys=["ctrl","a"] / ["alt","tab"] to spell one out — modifier(s) first, then the action key; each is a key name (ctrl/alt/shift/meta, a-z, enter, tab, ...) or a raw keycode. For a single key use press_key instead.
Inputs: keys, preset, serial.
input_textInput textA
Type text into the currently focused input field via the IME. Tap the field first so it has focus. Afterwards the soft keyboard may cover buttons lower on screen — dismiss it with press_key escape (or back) before tapping them. For native non-IME PIN pads this does nothing; use enter_pin instead.
Inputs: text (required), serial.
install_appInstall appAIdempotent
Install (or reinstall, -r) an APK from a local file path onto the device. Use to deploy a build you want to test.
Inputs: apk_path (required), serial.
is_device_secureIs device secureARead-only
Report whether a secure lock screen is set (probed with locksettings; this is what KeyguardManager.isDeviceSecure, which Keystore checks, reflects). Use it to verify set_device_lock worked before running a Keystore-gated flow.
Inputs: serial.
last_crashLast crashARead-only
Return the most recent app crash from the system DropBox (dumpsys dropbox — JVM/React-Native and native crashes), with the full exception header and stack in one call. Optionally filter to a package. Use this instead of grepping logcat when an app just crashed: DropBox keeps the whole fatal (header + Caused by + frames) together even after it has scrolled out of the logcat ring buffer.
Inputs: serial, package.
launch_appLaunch appA
Launch an app by package name (starts its LAUNCHER activity) and echo the resolved component on success. Fails with a clear message (not a raw monkey dump) when the package isn't installed or has no launcher activity. Combine with stop_app to restart an app cleanly from a known state.
Inputs: package (required), serial.
launch_dev_clientLaunch dev clientA
Launch an Expo dev build straight at a Metro dev server, skipping the Dev Launcher's server-picker screen. Builds the "://expo-development-client/?url=http://host:port" deep link and opens it. Pass scheme (your app.json "scheme"); host/port default to localhost:8081. PREREQUISITE: run adb_reverse {device_port: 8081} first so the device can reach Metro, otherwise the dev client falls back to its embedded bundle. For plain Expo Go (not a dev build) use open_url with the exp:// URL instead.
Inputs: scheme (required), host, port, serial, +1 more.
list_avdsList avdsARead-only
List the Android Virtual Devices (AVDs) installed on this machine that can be booted. Start here when no emulator is running yet; the returned names feed boot_emulator.
list_devicesList devicesARead-only
List attached emulators/devices and their adb state (device = ready, offline, unauthorized). Pass serial to check one device: only that device is returned, or a note listing what is attached (the session default serial is ignored here). Use it to confirm a device is up before driving it, or to get the serial when several are attached. Driving a React Native/Expo dev build? Follow the rn-expo guide before you start (a skill, or the android://guide/rn-expo resource) — the ordering (adb_reverse BEFORE launch, app_state before believing anything) is the part that costs sessions.
Inputs: serial.
list_gradle_projectsList gradle projectsARead-only
List the Gradle modules (sub-projects) in project_dir (gradlew projects) — the map of a multi-module build, e.g. :app, :core, :feature:login. Use it to find which module to point gradle_build/list_gradle_variants at, or to address a task at one module with ':' (e.g. :app:assembleDebug). A single-module build reports no sub-projects.
Inputs: project_dir.
list_gradle_tasksList gradle tasksADestructive
List the available Gradle tasks in project_dir (gradlew tasks) — to discover build/test/install targets. In a multi-module build this lists the ROOT project's own tasks by default; pass task=":tasks" (e.g. ":app:tasks", from list_gradle_projects) to scope to a submodule instead.
Inputs: task, project_dir.
list_gradle_variantsList gradle variantsADestructive
List the buildable build variants in project_dir (parsed from the assemble* tasks) — the Android analogue of "list schemes". Each variant V maps to an assembleV / installV Gradle task; pass it as the task= arg to gradle_build/build_and_run to disambiguate a multi-flavor project. Test-only APK tasks (androidTest/unitTest) are excluded. In a multi-module build the ROOT project usually has no variants of its own (no Android plugin applied there) — pass task=":tasks" (e.g. ":app:tasks", from list_gradle_projects) to scope to the module that actually builds APKs.
Inputs: task, project_dir.
list_packagesList packagesARead-only
List installed package names, optionally filtered by substring — to confirm an app is installed and get its exact package name for launch_app/stop_app.
Inputs: filter, serial.
logcatLogcatARead-only
Dump recent native log lines — the last N (default 400) or, with since="2m"/"90s", everything from that long ago on the device clock (the right axis when the report is 'I just hit an error'; on a chatty emulator 400 lines can span seconds). Optionally filtered by a case-insensitive substring, a minimum priority (V/D/I/W/E/F — e.g. priority="E" for errors and up), and/or tags (OR'd). This is how you find the REAL reason a native call failed when the UI only shows a generic 'X failed' alert: filter by your app tag or 'Exception'/'Caused by' and read the 'Caused by:' line — that is the root cause. Dumps and exits (does not stream); chatty spam is stripped.
Inputs: tags, lines, since, filter, +3 more.
long_pressLong pressA
Press and hold a coordinate (true device pixels) for a duration — for context menus, drag handles, and long-press actions.
Inputs: x (required), y (required), serial, duration_ms.
open_urlOpen URLA
Open a URL or deep link via an ACTION_VIEW intent (am start) — the way to jump straight to a deep-linked screen. Optionally target a specific package.
Inputs: url (required), serial, package.
phone_callPhone callA
Drive an emulated voice call (adb emu gsm). action="call" (default) rings an incoming call from number; "accept"/"cancel"/"busy"/"hold" transition an in-progress call. Use to test call-interruption behaviour and CALL_PHONE flows. Emulator-only.
Inputs: number (required), action, serial.
prefer_pinPrefer PINA
Try to move a standard BiometricPrompt to its PIN/password fallback by selecting an explicit system button, or sending BACK as the generic cancel path. App-controlled prompts may suppress or rename this option, so confirm the resulting PIN pad with describe_ui before calling enter_pin.
Inputs: serial.
press_keyPress keyA
Press a hardware/navigation key by name (enter, back, home, menu, tab, del, escape, up, down, left, right, dpad_center, app_switch, search, power, wakeup, sleep, volume_up, volume_down, ...) or a raw Android keycode number. Handy to submit a form (enter), dismiss the keyboard (escape), or go back (back). To turn the screen ON use wakeup (not power, which toggles and may sleep an awake screen); sleep turns it off. A key can be silently consumed with no effect (e.g. back while a biometric prompt is up) — pass verify_change=true to get ui_changed: true/false instead of guessing. Batching several presses (or a press whose timing matters relative to other actions) belongs in run_sequence, not in separate calls.
Inputs: key (required), serial, verify_change.
pull_filePull fileADestructive
Copy a file off the device to a local path (adb pull) — e.g. retrieve a generated file, database, or screenshot.
Inputs: local_path (required), device_path (required), serial.
push_filePush fileBDestructive
Copy a local file onto the device (adb push) — e.g. seed test data or a file to import.
Inputs: local_path (required), device_path (required), serial.
reload_appReload appA
Best-effort: trigger a Metro/JS reload on a React Native dev-client build via the classic .RELOAD_APP_ACTION broadcast. Only works on debug builds of classic (non-bridgeless) RN architectures that register the receiver — on newer RN/Expo dev clients it may silently no-op with no error. If the app doesn't visibly reload, use open_dev_menu then tap_on_text("Reload") instead. PREREQUISITE: the app must be able to reach Metro at all — run adb_reverse {device_port: 8081} first, or a reload lands you back on the EMBEDDED bundle and your edits still won't appear (app_state tells you which bundle the running process is actually serving).
Inputs: package (required), serial.
render_statsRender statsA
Count an app's REAL view tree and recent frame health: total views, render-node kB, per-window breakdown, jank percentage and frame-time percentiles, plus Choreographer's "Skipped N frames" tally. Use this — not describe_ui — to MEASURE a screen: describe_ui is viewport-scoped (Android drops off-screen ScrollView children from the accessibility tree), so it undercounts a long list even at filter="all". The three numbers together are what argues an unvirtualised list: a large view count, render-node kB that grows as you scroll, and skipped frames on the main thread. Pass reset=true to zero the frame counters after reading so the next call measures one specific interaction.
Inputs: package (required), reset, serial.
revoke_permissionRevoke permissionADestructiveIdempotent
Revoke a runtime permission from an app (pm revoke) — to test the denied path or re-trigger the permission-request dialog on next use. Pairs with grant_permission. Note: revoking some permissions kills the app process.
Inputs: package (required), permission (required), serial.
rotate_screenRotate screenA
Rotate the emulator to its next orientation (adb emu rotate) — the quick way to exercise landscape/portrait layout and rotation-driven state loss. Emulator-only.
Inputs: serial.
run_instrumented_testsRun instrumented testsADestructive
Run Gradle instrumented (on-device) tests (default task 'connectedAndroidTest') in project_dir — requires a booted device/emulator. Returns per-suite timing and failing-test stack traces; pass json=true for a structured JSON summary. Runs in the foreground and can take minutes; for a long run use gradle_build with task=connectedAndroidTest and background=true, then read the log.
Inputs: args, json, task, project_dir.
run_sequenceRun sequenceA
Run several interaction steps in ONE call — no agent round-trip between them. Use for scripted flows and, crucially, flows driven by NATIVE TIMERS (background-token clear, a biometric prompt that auto-fires on resume) where a round-trip per step would perturb the timing you're testing: e.g. key:home → sleep:19 → launch → sleep:9 → tap_text:Cancel (if_present:biometric) → assert_foreground(package) → describe_ui. Each step has an 'action' (sleep, tap, tap_text, tap_element, key, text, swipe, launch, stop, assert_foreground, wait_text, describe_ui) with its params; an if_present/if_absent guard skips a step unless a selector is (not) on screen — that's how you express a conditional cancel; and optional=true lets a step fail without aborting. Returns a per-step result (ok/skipped/error) with elapsed_ms plus the final hierarchy. A non-optional step error stops the rest.
Inputs: steps (required), serial, capture_final.
run_unit_testsRun unit testsADestructive
Run Gradle JVM unit tests (default task 'test') in project_dir and return the result summary, including per-suite timing and failing-test stack traces. On an Android project 'test' runs EVERY variant's unit tests (debug and release both); pass task="testDebugUnitTest" (or ":app:testDebugUnitTest" in a multi-module build) to run just one and roughly halve the time. Pass json=true for a structured JSON summary. Runs in the foreground and blocks until Gradle finishes; for a long run use gradle_build with this task and background=true, then read the log.
Inputs: args, json, task, project_dir.
scaffold_android_projectScaffold android projectA
Create a minimal Kotlin Android application in a new empty directory, including Gradle Kotlin DSL files, an AndroidManifest, a launcher Activity, resources, README, and gitignore. The tool never overwrites a non-empty directory. It also generates the Gradle wrapper when a system gradle is on PATH, so the result is immediately buildable with gradle_build; if no gradle is installed the result says so, and gradle wrapper has to be run in that directory before any Gradle tool here will work (they all drive ./gradlew).
Inputs: name (required), package (required), destination (required).
screenshotScreenshotARead-only
Capture the current screen as a PNG so you can SEE the UI state. Call it after every action to confirm the screen changed before acting again — driving blind chains taps onto the wrong screen. The image is auto-downscaled (default max 760px) so it is accepted by the image reader; this is for seeing only — derive tap coordinates from describe_ui, not from this image. Auto-retries an all-black frame (an intermittent capture glitch) and, if it stays black, says why (FLAG_SECURE content like a native PIN pad, or a sleeping display) — when black, use describe_ui instead. Works on multi-display foldables (the default display captures correctly); pass display="cover"/"inner"/an index to grab a specific panel.
Inputs: serial, display, max_dim.
send_smsSend SMSA
Deliver an incoming SMS to the emulator (adb emu sms send) — the standard way to drive OTP / 2FA flows without a second phone. Pass a sender number (from) and the message text (e.g. the code). Emulator-only.
Inputs: from (required), text (required), serial.
session_clear_defaultsSession clear defaultsAIdempotent
Clear any project_dir/serial defaults pinned for this session, reverting to requiring them on every call (serial still falls back to the single-attached-device default).
session_set_defaultsSession set defaultsAIdempotent
Pin a default project_dir and/or serial for the rest of this session so later calls can omit them — the fix for a multi-module or multi-flavor project (or multiple attached devices) forcing you to repeat the same project_dir/serial on every Gradle or device call. Only the fields you pass are changed; omit a field to leave its current default alone. An explicit project_dir/serial on any individual call always overrides the session default for that one call.
Inputs: serial, project_dir.
session_show_defaultsSession show defaultsARead-only
Show the project_dir/serial defaults currently pinned for this session (set via session_set_defaults).
set_batterySet batteryAIdempotent
Set the battery level (0-100) and/or charging state — test low-battery UI and charging-only logic deterministically. On an emulator it uses the console (adb emu power); on a PHYSICAL device it forces the values via dumpsys battery, which persist until you call this again with reset=true (or the device reboots). Provide level, charging, or both — or reset=true to restore automatic reporting. (For a fake battery in a clean SCREENSHOT status bar only, use set_status_bar instead.)
Inputs: level, reset, serial, charging.
set_dark_modeSet dark modeAIdempotent
Turn the system dark theme on or off (cmd uimode night) — to test light/dark appearances. The mode it found is remembered and put back when the server exits (when it could be read); call it again with the original value to restore it sooner, and doctor lists it while it is changed.
Inputs: enabled (required), serial.
set_device_lockSet device lockADestructive
Set a secure lock screen (type: pin [default], pattern, or password). REQUIRED before AndroidKeyStore / Keystore-backed crypto flows, which fail with 'A secure lock screen is required' on a fresh emulator that has no lock. Follow with is_device_secure to confirm.
Inputs: value (required), type, serial, old_value.
set_locationSet locationAIdempotent
Set the emulator's mock GPS location (longitude, latitude) — for location-gated features.
Inputs: latitude (required), longitude (required), serial.
set_sensorSet sensorAIdempotent
Set an emulated hardware sensor value (adb emu sensor set) — drive accelerometer/gyroscope/orientation (pass x, y, z) or a single-value sensor like light/proximity/temperature/pressure/humidity (pass x only). Use to exercise shake/tilt/rotation handlers or ambient-light/proximity logic. Emulator-only.
Inputs: x (required), sensor (required), y, z, +1 more.
set_status_barSet status barAIdempotent
Pin a clean status bar via SystemUI demo mode (enabled=true) — fixed clock, chosen signal/battery, no notification icons by default — so screenshots for docs don't leak the wall clock or a random signal state. Optionally set clock (HHMM), battery (0-100), network_type (wifi/mobile/none) with mobile_level/data_type/carrier for mobile, and notifications_visible/notification_icon. Call with enabled=false to restore the live bar.
Inputs: enabled (required), clock, serial, battery, +6 more.
shutdown_emulatorShutdown emulatorADestructiveIdempotent
Power off a running emulator (adb emu kill). Use when you are done with a device you booted.
Inputs: serial.
start_logcat_captureStart logcat captureADestructive
Begin streaming logcat into a buffer for this device (optionally clearing first). Pair with stop_logcat_capture to get everything logged DURING a flow — use this instead of the one-shot 'logcat' when you need logs across an interaction.
Inputs: clear, serial.
start_screen_recordStart screen recordA
Start recording the screen to an mp4 on the device (Android caps a single recording at ~180s). Pair with stop_screen_record. The display must be awake: an asleep display sends no frames and the recording comes out empty (the result warns; stay_awake fixes it).
Inputs: serial.
stay_awakeStay awakeAIdempotent
Keep the display from dozing during a driving session (svc power stayon true) — the fix when screenshots keep coming back black with screen_off:true because the device sleeps between steps (common on emulators with a short timeout). enabled=true holds the screen on while charging (emulators always are); enabled=false restores the normal timeout. describe_ui works regardless, but any screenshot/coordinate flow needs the screen on.
Inputs: enabled (required), serial.
stop_appStop appAIdempotent
Force-stop an app by package name. Pair with launch_app to reset an app to a clean start when reproducing a bug.
Inputs: package (required), serial.
stop_logcat_captureStop logcat captureA
Stop the running logcat capture and return what was collected since start, optionally filtered by a case-insensitive substring, a minimum priority (V/D/I/W/E/F), and/or tags (OR'd). Output is capped to the last 500 lines by default (override with tail) so a long capture doesn't blow the token budget — narrow with the filters first.
Inputs: tags, tail, filter, redact, +2 more.
stop_screen_recordStop screen recordADestructive
Stop the screen recording, finalize the mp4, and pull it to a local path. Fails with an explanation if the recording holds no frames (the display was asleep) instead of saving an empty file.
Inputs: local_path (required), serial.
swipeSwipeA
Swipe/drag from a start point to an end point. Params: x1,y1 (start) and x2,y2 (end) in true device pixels — x and y are accepted aliases for x1 and y1. To SCROLL DOWN a list, swipe from a HIGH y to a LOW y (drag the content up); reverse to scroll up. A longer duration_ms gives a slower, controlled drag; a short one flings.
Inputs: x2 (required), y2 (required), x, y, +4 more.
tapTapA
Tap a single coordinate in true device pixels. Use a center value from describe_ui. If a tap seems to do nothing, the coordinate is almost always stale/misscaled — re-run describe_ui and use a fresh center. Prefer tap_on_text when you know the element's label. When a tap lands but nothing happens, pass identify=true (reports which element the coordinate hit — or that it hit a non-clickable wrapper / no reported element) and/or verify_change=true (reports whether the UI actually changed) to tell the failure modes apart. Note: some native views (e.g. Compose/RN NativeTabs bars) don't respond to coordinate taps at all — use tap_on_text/tap_element with via_accessibility=true there (EXPERIMENTAL, requires adb-mcp bridge install once per device).
Inputs: x (required), y (required), serial, identify, +1 more.
tap_elementTap elementA
Find an element by resource_id and tap its center — the id-addressed sibling of tap_on_text, for elements with no visible label. Runs describe_ui internally (filter=all, so even unlabeled wrapper nodes are findable) and re-resolves the element right before tapping, narrowing the window where a stale coordinate lands on an overlay (e.g. an Expo dev-menu bubble) the a11y tree never reported. Use exact match (partial=false) to avoid hitting the wrong item when ids overlap; verify_change reports whether the tap had any visible effect. If a coordinate tap lands but nothing happens (e.g. a Compose/RN NativeTabs bar), pass via_accessibility=true to dispatch a real accessibility click instead (EXPERIMENTAL — see that param's description).
Inputs: resource_id (required), serial, partial, verify_change, +1 more.
tap_on_textTap on textA
Find an element by its visible text or content-description and tap its center — the one-shot way to press a labelled button/row without computing coordinates yourself. Runs describe_ui internally and prefers a clickable match. Matching folds typographic punctuation to ASCII, so a typed "Don't allow" finds the system dialog's "Don’t allow" (U+2019) and an en/em dash matches a hyphen. Use exact match (partial=false) to avoid hitting the wrong item when labels overlap. If a coordinate tap lands but nothing happens (e.g. a Compose/RN NativeTabs bar), pass via_accessibility=true to dispatch a real accessibility click instead (EXPERIMENTAL — see that param's description).
Inputs: text (required), serial, partial, verify_change, +1 more.
uninstall_appUninstall appADestructiveIdempotent
Uninstall an app by package name (adb uninstall). Use to remove a build before a clean install, or to verify first-run behavior after reinstalling. To keep the app but reset it, prefer clear_app_data.
Inputs: package (required), serial.
waitWaitARead-only
Sleep for a number of seconds (fractions ok, capped at 300), then return. For TIME-based conditions where wait_for_text's polling doesn't apply: backgrounding an app long enough to trip a native auth timer, waiting out a cooldown or rate limit, letting a long animation finish. If the sleep sits BETWEEN actions whose timing you are testing, put the whole flow in run_sequence instead — an agent round-trip per step perturbs native timers.
Inputs: seconds (required).
wait_for_bootWait for bootARead-only
Block until a device finishes booting (sys.boot_completed=1). Only needed if you started an emulator elsewhere; boot_emulator already waits by default.
Inputs: serial, timeout_s.
wait_for_textWait for textA
Poll the UI until an element with the given text/content-description appears (or times out), then return it. Use this after an async action (network load, navigation, animation) instead of a blind wait-then-screenshot — it returns as soon as the element is present, with its tappable center. Note: canvas-drawn (RN/Skia) text never enters the hierarchy, so it will time out on those — screenshot instead.
Inputs: text (required), scroll, serial, partial, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 81 tools
Most tools have a clearly distinct verb+resource target, and the descriptions explicitly disambiguate the risky clusters (tap vs tap_on_text vs tap_element, logcat vs start/stop_logcat_capture, wait vs wait_for_text vs wait_for_boot, Gradle build vs build_and_run). Remaining soft spots are among the Gradle inspection tools (list_gradle_projects/tasks/variants, gradle_project_properties) and the session defaults trio, which an agent could still mix up.
The surface is overwhelmingly consistent snake_case with a verb_noun pattern (install_app, launch_app, set_dark_mode, start_screen_record). A handful of bare-noun or single-verb outliers (doctor, logcat, cellular, screenshot, tap, swipe, drag) deviate but remain readable and never mix casing conventions.
81 tools is far beyond a well-scoped set, even for a broad ADB/emulator/build domain; selection burden and description volume are high. Several clusters could be consolidated (three session-defaults tools, three Gradle-listing tools, gradle_build/build_and_run/build_status/cancel_build, start/stop capture pairs), though each tool does map to a real operation rather than being filler.
Coverage is extensive: device/emulator lifecycle, UI inspection and input, permissions, locks/biometrics, sensors/network/battery, logging, file push/pull, recording, Gradle build/test/coverage, and session defaults. Minor gaps remain around clipboard, notification injection, locale/date configuration, and app-private file/database inspection, but none block core device-driving workflows.
Maintenance
Related MCP Connectors
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Cloud iOS simulators and Android emulators your agent can create, drive, and throw away.
Disposable cloud Android emulators for coding agents: run an APK or PR build, tap, type, screenshot.
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
Related MCP Servers
- AlicenseBqualityBmaintenanceA Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.832,731 npm6,598MIT
- AlicenseAqualityNot gradedmaintenanceEnables browser automation through Playwright using accessibility tree snapshots instead of screenshots. Supports web scraping, form interactions, testing, and connecting to existing browser sessions with logged-in accounts.238,303 npm5-
- AlicenseAqualityDmaintenanceEnables an agent to inspect and interact with Android emulators or physical devices via ADB, capturing UI snapshots, tapping nodes, typing text, and reading app logs.10MIT
- AlicenseAqualityDmaintenanceEnables AI agents to build, deploy, drive, and debug Android apps — managing Gradle builds, emulators, adb deployment, logcat capture, and full UI automation.5385 npm1MIT