Android DevTools MCP
This server lets an AI agent inspect and control Android emulators or physical devices via ADB, enabling a Chrome DevTools-style UI automation workflow.
List connected devices (
android_list_devices): Enumerate all ADB-connected emulators and physical devices, including offline and unauthorized ones.Capture UI hierarchy (
android_take_snapshot): Capture a compact semantic UI Automator tree to identify and target UI nodes by resource ID, text, content description, class, and state flags.Take screenshots (
android_take_screenshot): Capture the current Android display as a PNG image.Inspect app state (
android_get_app_state): Retrieve the foreground package/activity, process state, and display metadata.Tap the screen (
android_tap): Tap explicit screen coordinates or a safely revalidated node from the latest snapshot (verifying the node still occupies the same bounds before acting).Type text (
android_type_text): Type ADB-safe ASCII text into the focused UI field, with an option to clear existing content first.Swipe gestures (
android_swipe): Perform a swipe gesture between two screen coordinates with a configurable duration.Press keys (
android_press_key): Send Android key events by name (e.g., Back, Home, Enter, Delete, directional keys) or by numeric keycode.Wait for UI state (
android_wait_for): Poll the semantic UI hierarchy until a matching node exists, disappears, or reaches a specific state (enabled, checked, selected, focused).Read app logs (
android_get_logs): Retrieve bounded, filtered logcat output scoped to a specific application's current process IDs, with configurable log level and line limits.
Allows interaction with Android devices (emulators or physical devices) via ADB, enabling UI inspection, tapping, text input, swiping, key events, and log retrieval.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Android DevTools MCP take a snapshot of the current UI"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Android DevTools MCP
An MCP server that lets an agent inspect and operate an already-running Android emulator or physical device through ADB.
It provides a Chrome-DevTools-style workflow:
Capture a semantic UI snapshot or screenshot.
Identify a UI node.
Tap the revalidated node, type text, swipe, or press a key.
Inspect the resulting UI, foreground activity, and application logs.
The server talks to Android through ADB, not directly to QEMU. This keeps the same interface usable with Android Studio emulators, headless emulators, third-party QEMU frontends, and physical devices.
Requirements
Node.js 20 or later
Android SDK Platform Tools with
adbavailable onPATH, orADB_PATHset to the executableA booted device visible in
adb devices -lUSB debugging authorization accepted for physical devices
The server attaches to existing devices. It does not start AVDs, install APKs, or launch applications.
Related MCP server: Android MCP
Build and run
npm install
npm run build
node dist/cli.jsThe process uses MCP stdio, so its standard output is reserved for protocol messages. Operational messages are written to standard error.
Example MCP client configuration for this checkout:
{
"mcpServers": {
"android-devtools": {
"command": "node",
"args": [
"<path-to-repo>/dist/cli.js"
],
"env": {
"ANDROID_SERIAL": "emulator-5554"
}
}
}
}ANDROID_SERIAL is optional when exactly one ready device is connected. Use
ADB_PATH when adb is not on PATH.
Tools
Tool | Purpose |
| List ready, offline, and unauthorized ADB devices |
| Return a compact semantic UI hierarchy |
| Return the current display as PNG |
| Inspect foreground activity, process, and display state |
| Tap coordinates or a revalidated snapshot node |
| Clear and type into the focused field |
| Perform a coordinate-based swipe |
| Send Android key events |
| Wait for a selector and semantic state |
| Return bounded logcat lines for an app's current PIDs |
Snapshot selectors use exact AND matching over resource ID, text, content description, class, and state flags. Node IDs are scoped to one snapshot. Before a node tap, the server captures a fresh hierarchy and verifies that the same semantic node still occupies the same bounds. It returns a stale or ambiguous-target error instead of tapping when that check fails.
Verification
npm run check
npm test
npm run buildThere is also an opt-in smoke test for a disposable emulator. It sends the Home key and reads the current launcher's logs:
$env:ANDROID_MCP_TEST_SERIAL = "emulator-5554"
npm run test:deviceLimitations
UI Automator exposes the accessibility/semantic tree, not Android Studio's private Layout Inspector data.
Canvas-rendered interfaces, games, protected windows, and some WebViews may only be inspectable through screenshots and coordinates.
Compose elements need usable semantics to appear as distinct nodes.
Text entry intentionally accepts only ADB-safe ASCII: letters, numbers, spaces, and
.,_@+-/:=. Unicode input requires an optional device-side input method or instrumentation component and is not part of this release.Network tracing, CPU/memory profiling, frame timing, AVD lifecycle, and APK management are outside the current black-box scope.
Available Tools
10 toolsandroid_get_app_stateGet Android app stateARead-onlyIdempotent
Get the foreground package/activity, optional package process state, and display metadata.
Inputs: serial, package.
android_get_logsGet Android app logsARead-onlyIdempotent
Read bounded logcat output filtered to the requested or foreground application's current process IDs.
Inputs: level, serial, package, maxLines.
android_list_devicesList Android devicesARead-onlyIdempotent
List all ADB-connected emulators and physical devices, including offline and unauthorized targets.
Inputs: no named parameters.
android_press_keyPress Android keyADestructive
Press Back, Home, Enter, Delete, a directional key, a KEYCODE_* name, or a numeric Android keycode.
Inputs: key (required), serial.
android_swipeSwipe Android UIBDestructive
Perform a swipe gesture between two screen coordinates.
Inputs: to (required), from (required), serial, durationMs.
android_take_screenshotCapture Android screenshotCRead-onlyIdempotent
Capture the current Android display as a PNG image.
Inputs: serial.
android_take_snapshotInspect Android UIARead-onlyIdempotent
Capture a compact UI Automator hierarchy. Use its snapshot and node IDs for safe node-targeted taps.
Inputs: serial.
android_tapTap Android UIBDestructive
Tap either explicit screen coordinates or a node from the latest snapshot. Node taps are revalidated before acting.
Inputs: x, y, nodeId, serial, +1 more.
android_type_textType text in AndroidADestructive
Type ADB-safe ASCII text into the focused UI node. Optionally clear its existing content first.
Inputs: text (required), clear, serial.
android_wait_forWait for Android UI stateARead-onlyIdempotent
Poll the semantic UI until matching nodes exist, disappear, or have the requested state.
Inputs: state (required), selector (required), serial, timeoutMs, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clearly distinct purpose: device listing, app state, logs, input methods (tap, swipe, key, type), UI capture (screenshot, snapshot), and UI waiting. No overlaps.
All tools follow the consistent prefix 'android_' and use snake_case with verb_noun pattern (e.g., get_app_state, press_key, take_screenshot). Minor exception with 'wait_for' but still consistent pattern.
10 tools is well-scoped for Android UI automation, covering essential actions without being too many or too few.
Covers core UI interaction (tap, swipe, type, key press), device info, logging, screenshots, and UI hierarchy snapshots. Missing actions like long press or scroll, but these can be worked around.
Maintenance
Related MCP Connectors
Give your AI agent a real cloud Android phone: push APKs, drive it, get screenshots and logs.
Disposable cloud Android emulators for coding agents: run an APK or PR build, tap, type, screenshot.
Cloud Android phones for AI agents: create a phone, read the screen, tap, type, install APKs, park.
Let AI agents control Android and iOS devices on Mobilerun Cloud: screen, input, apps, workflows.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI agents to interact with Android devices through UI manipulation, screen capture, touch gestures, text input, and app management via ADB. Provides comprehensive mobile automation capabilities including element detection, navigation, and application control for Android device testing and interaction.9123 PyPI2-
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Android devices and emulators through ADB, allowing control actions like tapping, text input, screenshots, UI inspection, and app launching through natural language.8-
- AlicenseBqualityCmaintenanceEnables AI agents to control the Android Emulator through adb, including booting AVDs, installing and managing apps, interacting with the UI, taking screenshots, reading logs, and more.37MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to visually perceive and directly control Android devices via ADB and screen-control tooling, including screenshots, taps, swipes, typing, app management, UI inspection, file transfer, shell commands, and audio/video streaming.392 npmMIT