adb-mcp
v0.1.2Model Context Protocol (MCP) server for Android ADB: inspect databases, capture screenshots, manage apps, edit SharedPreferences, and control devices with AI…
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_devices List connected devices
Lists every connected Android device and emulator with its id, model and connection state. Use this first when no target is set, or when a call reports NO_DEVICE or AMBIGUOUS_DEVICE.
set_target Set target device and package
Pins the device and/or Android package that every other tool will act on, so they do not have to be passed on each call. Set this once at the start of a session. With a single device connected the device is inferred automatically, and the package is detected from the workspace when the client exposes roots.
| Parameter | Type | Description |
|---|---|---|
device | string | Device id exactly as list_devices reports it, e.g. "emulator-5554". |
packageName | string | Android applicationId, e.g. "com.example.app". |
get_device_info Get device information
Returns OS version, SDK level, manufacturer, model, ABI, screen size, density, battery level and dark-mode state for the target device. Call this before reasoning about layout, API availability or power behaviour.
| Parameter | Type | Description |
|---|---|---|
device | string | Device id. Defaults to the target set by set_target. |
take_screenshot Take device screenshot
Captures a live screenshot of the connected Android device screen as a PNG image. Returns multimodal image content suitable for visual analysis and verification.
| Parameter | Type | Description |
|---|---|---|
device | string | Device id. Defaults to sticky target device if not specified. |
savePath | string | Optional local file path to save the captured PNG image to. |
dump_view_hierarchy Dump UI view hierarchy
Captures the current on-screen Android view hierarchy via UIAutomator, returning structured JSON nodes with text, resourceId, contentDesc, clickable state, and bounding box coordinates.
| Parameter | Type | Description |
|---|---|---|
compressed | boolean | When true (default), filters out non-interactive empty layout containers to reduce token consumption. |
device | string | Device id. Defaults to sticky target device if not specified. |
tap_coordinates Tap screen coordinates
Performs a single tap touch event at specific (x, y) pixel coordinates on the screen.
| Parameter | Type | Description |
|---|---|---|
x * | number | X coordinate on screen in pixels. |
y * | number | Y coordinate on screen in pixels. |
device | string | Device id. Defaults to sticky target device if not specified. |
tap_element Tap UI element by text or resource ID
Finds an on-screen UI element by its text, resource ID, or content description and taps its center. Automatically inspects the view hierarchy to locate the target.
| Parameter | Type | Description |
|---|---|---|
contentDesc | string | Accessibility content description to match. |
device | string | Device id. Defaults to sticky target device if not specified. |
resourceId | string | Android resource-id (e.g. "btn_login" or "com.example.app:id/submit"). |
text | string | Visible button or label text to find and tap (case-insensitive match). |
input_text Type text into active input field
Types the specified string into the currently focused text field on the device. Automatically escapes spaces and shell characters.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text string to type into the focused input field. |
device | string | Device id. Defaults to sticky target device if not specified. |
press_key Press hardware or navigation key
Dispatches a key event to the device. Supports named keys (BACK, HOME, RECENTS/APP_SWITCH, ENTER, LOCK/POWER, VOLUP, VOLDOWN, TAB, DELETE/BACKSPACE, ESCAPE, CAMERA, MENU, SEARCH, UP, DOWN, LEFT, RIGHT, CENTER) or direct Android integer keycodes.
| Parameter | Type | Description |
|---|---|---|
key * | string | number | Key name (e.g. "BACK", "HOME", "ENTER", "RECENTS", "LOCK") or integer keycode. |
device | string | Device id. Defaults to sticky target device if not specified. |
swipe_screen Swipe or scroll screen
Performs a swipe gesture across the screen. Specify either a high-level direction ("up", "down", "left", "right") or explicit start and end (x, y) pixel coordinates.
| Parameter | Type | Description |
|---|---|---|
device | string | Device id. Defaults to sticky target device if not specified. |
direction | string | High-level swipe direction: "up" scrolls down, "down" scrolls up, "left" scrolls right, "right" scrolls left. |
durationMs | number | Swipe duration in milliseconds (default 300ms). |
endX | number | End X pixel coordinate. |
endY | number | End Y pixel coordinate. |
startX | number | Start X pixel coordinate. |
startY | number | Start Y pixel coordinate. |
open_deep_link Open deep link or URL scheme
Dispatches an Android VIEW Intent with a URI (e.g. "https://example.com/path" or "myapp://item/42"). Optionally targets a specific package name to prevent chooser dialogs.
| Parameter | Type | Description |
|---|---|---|
url * | string | Deep link URI or web URL to dispatch. |
device | string | Device id. Defaults to sticky target device if not specified. |
packageName | string | Optional package name to route the Intent directly to. |
install_app Install APK on device
Installs an APK file from the host filesystem onto the target device with optional permission granting and reinstall flags.
| Parameter | Type | Description |
|---|---|---|
apkPath * | string | Absolute local filesystem path to the .apk file on the host machine. |
allowDowngrade | boolean | Allow version downgrade (-d flag). Default false. |
allowTestOnly | boolean | Allow test-only packages (-t flag). Default true. |
device | string | Device id. Defaults to sticky target device if not specified. |
grantPermissions | boolean | Grant all runtime permissions listed in the manifest (-g flag). Default true. |
reinstall | boolean | Reinstall existing app, keeping its data (-r flag). Default true. |
uninstall_app Uninstall application
Uninstalls an application package from the device.
| Parameter | Type | Description |
|---|---|---|
device | string | Device id. Defaults to sticky target device if not specified. |
keepData | boolean | Keep application data and cache directories (-k flag). Default false. |
packageName | string | Package applicationId to uninstall. Defaults to sticky target package. |
list_packages List installed packages
Queries installed applications on the device with filtering by third-party, system, or enabled/disabled state.
| Parameter | Type | Description |
|---|---|---|
device | string | Device id. Defaults to sticky target device if not specified. |
filter | string | Filter packages: "third_party" (default), "system", "all", "enabled", or "disabled". |
includeApkPath | boolean | When true, returns the filesystem path to the installed base APK. |
query | string | Optional search query to filter package names by substring. |
start_app Start application or activity
Launches an application main launcher activity or starts a specific Activity class component.
| Parameter | Type | Description |
|---|---|---|
activity | string | Optional specific Activity component to launch (e.g. ".MainActivity" or "com.example.app/.ui.HomeActivity"). |
device | string | Device id. Defaults to sticky target device if not specified. |
packageName | string | Package applicationId to start. Defaults to sticky target package. |
stopFirst | boolean | When true, force-stops the app before starting to guarantee a cold launch. |
stop_app Force-stop application
Terminates all running processes of the target application package (`am force-stop`).
| Parameter | Type | Description |
|---|---|---|
device | string | Device id. Defaults to sticky target device if not specified. |
packageName | string | Package applicationId to stop. Defaults to sticky target package. |
restart_app Restart application
Force-stops and re-launches the application for a clean restart.
| Parameter | Type | Description |
|---|---|---|
activity | string | Optional specific Activity class to start after stopping. |
device | string | Device id. Defaults to sticky target device if not specified. |
packageName | string | Package applicationId to restart. Defaults to sticky target package. |
clear_app_data Clear application data and cache
Clears all user data, database records, and cache for the application (`pm clear`).
| Parameter | Type | Description |
|---|---|---|
device | string | Device id. Defaults to sticky target device if not specified. |
packageName | string | Package applicationId whose data to reset. Defaults to sticky target package. |
restart | boolean | Automatically relaunch the application after clearing data. Default false. |
grant_permission Grant runtime permission
Grants an Android runtime permission to the target application (e.g. "CAMERA", "POST_NOTIFICATIONS", "ACCESS_FINE_LOCATION").
| Parameter | Type | Description |
|---|---|---|
permission * | string | Permission name (e.g. "CAMERA", "POST_NOTIFICATIONS", or full "android.permission.CAMERA"). |
device | string | Device id. Defaults to sticky target device if not specified. |
packageName | string | Package applicationId. Defaults to sticky target package. |
revoke_permission Revoke runtime permission
Revokes a granted runtime permission from the application.
| Parameter | Type | Description |
|---|---|---|
permission * | string | Permission name to revoke (e.g. "CAMERA", "POST_NOTIFICATIONS"). |
device | string | Device id. Defaults to sticky target device if not specified. |
packageName | string | Package applicationId. Defaults to sticky target package. |
get_app_info Get application info and permissions
Inspects installed package details: version name, version code, target SDK, min SDK, install times, and requested/granted permissions.
| Parameter | Type | Description |
|---|---|---|
device | string | Device id. Defaults to sticky target device if not specified. |
packageName | string | Package applicationId to inspect. Defaults to sticky target package. |
list_databases List application SQLite databases
Lists all SQLite database files located inside the application sandbox (`/data/data/<pkg>/databases/`).
| Parameter | Type | Description |
|---|---|---|
device | string | Device id. Defaults to sticky target device. |
packageName | string | Package applicationId. Defaults to sticky target package. |
inspect_database_overview Inspect database overview table
Generates an inventory table summarizing all tables in the database with their row counts and column counts.
| Parameter | Type | Description |
|---|---|---|
database * | string | SQLite database file name (e.g. "app.db" or "users_database"). |
device | string | Device id. Defaults to sticky target device. |
packageName | string | Package applicationId. Defaults to sticky target package. |
list_database_tables List tables in a database
Lists all user tables defined inside the specified SQLite database.
| Parameter | Type | Description |
|---|---|---|
database * | string | SQLite database file name. |
device | string | Device id. Defaults to sticky target device. |
packageName | string | Package applicationId. Defaults to sticky target package. |
get_table_schema Get table column definitions & schema
Inspects column names, data types, nullability, default values, and primary key flags for a specific table.
| Parameter | Type | Description |
|---|---|---|
database * | string | SQLite database file name. |
table * | string | Table name to inspect. |
device | string | Device id. Defaults to sticky target device. |
packageName | string | Package applicationId. Defaults to sticky target package. |
get_table_data Browse table rows with pagination
Fetches rows, columns, and total row count from a table with pagination (`limit` and `offset`) and sorting support.
| Parameter | Type | Description |
|---|---|---|
database * | string | SQLite database file name. |
table * | string | Table name to browse. |
device | string | Device id. Defaults to sticky target device. |
limit | number | Maximum number of rows to return (default 50). |
offset | number | Row offset for pagination (default 0). |
orderBy | string | Optional ORDER BY clause (e.g. "id DESC" or "created_at ASC"). |
packageName | string | Package applicationId. Defaults to sticky target package. |
create_database_table Create a new table in database
Creates a new SQLite table with structured column definitions or raw SQL DDL.
| Parameter | Type | Description |
|---|---|---|
database * | string | SQLite database file name. |
tableName * | string | Table name to create. |
columns | array | List of column definitions. |
device | string | Device id. Defaults to sticky target device. |
ifNotExists | boolean | Add IF NOT EXISTS clause (default true). |
packageName | string | Package applicationId. Defaults to sticky target package. |
rawSql | string | Raw CREATE TABLE SQL statement (overrides columns if provided). |
query_database Execute SQL query on database
Runs an arbitrary SQL query (SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, etc.) against an app database. SELECT queries return structured JSON columns and rows.
| Parameter | Type | Description |
|---|---|---|
database * | string | SQLite database file name. |
sql * | string | SQL statement to execute. |
device | string | Device id. Defaults to sticky target device. |
packageName | string | Package applicationId. Defaults to sticky target package. |
delete_database_row Delete specific row(s) from a table
Deletes matching row(s) from a table using a WHERE filter condition.
| Parameter | Type | Description |
|---|---|---|
database * | string | SQLite database file name. |
table * | string | Table name to delete from. |
where * | string | WHERE filter condition clause (e.g. "id = 42" or "status = 'archived'"). |
device | string | Device id. Defaults to sticky target device. |
packageName | string | Package applicationId. Defaults to sticky target package. |
clear_database_table Clear all data from a table (truncate)
Wipes all records from a table (`DELETE FROM <table>;`) and optionally resets its SQLite auto-increment sequence.
| Parameter | Type | Description |
|---|---|---|
database * | string | SQLite database file name. |
table * | string | Table name to clear. |
device | string | Device id. Defaults to sticky target device. |
packageName | string | Package applicationId. Defaults to sticky target package. |
resetAutoIncrement | boolean | Reset auto-increment ID counter (default true). |
export_database Export database file to host
Downloads/exports a copy of the SQLite database (merging WAL journals) to a local host destination file path.
| Parameter | Type | Description |
|---|---|---|
database * | string | SQLite database file name on device. |
destinationPath * | string | Local absolute filesystem destination file path on the host machine. |
device | string | Device id. Defaults to sticky target device. |
packageName | string | Package applicationId. Defaults to sticky target package. |
get_logcat Get Logcat logs
Retrieves filtered Android system and application logs non-blockingly. Supports filtering by application package (PID-scoped), minimum log level, tag, and search query.
| Parameter | Type | Description |
|---|---|---|
clearFirst | boolean | If true, clears the logcat buffer before capturing logs. |
device | string | Device serial/identifier. Defaults to sticky target device. |
filterByPackage | boolean | Filter logs to only this package/PID when packageName is present. Set to false to see system-wide logs. |
lineLimit | integer | Maximum number of recent log lines to return (1-2000, default 200). |
logLevel | string | Minimum log level: V (Verbose), D (Debug), I (Info), W (Warn), E (Error), F (Fatal). |
packageName | string | Package applicationId to filter logs for. Defaults to sticky target package if set. |
search | string | Case-insensitive substring search filter across log messages. |
tag | string | Filter logs by a specific Logcat tag (e.g. "ActivityManager", "AndroidRuntime"). |
clear_logcat Clear Logcat buffer
Clears the Android logcat circular buffer on the device.
| Parameter | Type | Description |
|---|---|---|
device | string | Device serial/identifier. Defaults to sticky target device. |
get_app_memory Inspect app memory consumption
Analyzes process memory allocation for a given package using dumpsys meminfo. Provides structured totals in MB and detailed breakdowns of Java Heap, Native Heap, Graphics, Code, and Stack.
| Parameter | Type | Description |
|---|---|---|
device | string | Device serial/identifier. Defaults to sticky target device. |
packageName | string | Package applicationId. Defaults to sticky target package. |
set_battery_level Set simulated battery level
Simulates a specific battery level percentage (0-100) and automatically unplugs device from power.
| Parameter | Type | Description |
|---|---|---|
level * | number | Battery percentage level from 0 to 100. |
device | string | Device serial/identifier. Defaults to sticky target device. |
unplug_battery Simulate battery unplugged (discharging)
Simulates disconnecting the Android device from charger / AC power supply (sets state to discharging).
| Parameter | Type | Description |
|---|---|---|
device | string | Device serial/identifier. Defaults to sticky target device. |
reset_battery Reset battery to hardware state
Restores battery reporting and charging status to the physical / real hardware state.
| Parameter | Type | Description |
|---|---|---|
device | string | Device serial/identifier. Defaults to sticky target device. |
force_doze_mode Force device into Doze mode
Forces device into deep Doze mode (idle state) for testing background jobs, alarms, and battery optimizations.
| Parameter | Type | Description |
|---|---|---|
device | string | Device serial/identifier. Defaults to sticky target device. |
exit_doze_mode Exit Doze mode
Unforces Doze mode and restores normal active operation on the device.
| Parameter | Type | Description |
|---|---|---|
device | string | Device serial/identifier. Defaults to sticky target device. |
toggle_dark_mode Toggle or set system Dark Mode
Switches system UI theme between Dark Mode and Light Mode, or sets an explicit mode.
| Parameter | Type | Description |
|---|---|---|
device | string | Device serial/identifier. Defaults to sticky target device. |
mode | string | Explicit theme mode ("light" or "dark"), or "toggle" (default). |
toggle_animations Toggle or set system animations
Enables or disables system UI animations (window, transition, and animator scales) or toggles between 1.0x and 0.0x.
| Parameter | Type | Description |
|---|---|---|
device | string | Device serial/identifier. Defaults to sticky target device. |
enabled | boolean | Explicitly set animations ON (true: 1.0x), OFF (false: 0.0x), or omit to toggle current state. |
send_broadcast Send Android broadcast intent
Sends a custom broadcast intent to registered receivers with optional target package, component, and typed extras.
| Parameter | Type | Description |
|---|---|---|
action * | string | Broadcast intent action string (e.g. "android.intent.action.BOOT_COMPLETED" or "com.example.ACTION_SYNC"). |
component | string | Explicit receiver component class (e.g. "com.example.app/.receiver.MyReceiver"). |
device | string | Device serial/identifier. Defaults to sticky target device. |
extras | object | Key-value dictionary of intent extra values (strings, numbers, booleans). |
packageName | string | Package applicationId to restrict the broadcast to. |
list_directory List device directory contents
Lists all files and directories at a remote path on the Android device with detailed metadata (type, permissions, size, date).
| Parameter | Type | Description |
|---|---|---|
device | string | Device serial/identifier. Defaults to sticky target device. |
path | string | Remote path on the Android device (default: "/sdcard"). |
read_device_file Read device file content
Reads text content of a remote file directly on the Android device without downloading it to the host.
| Parameter | Type | Description |
|---|---|---|
path * | string | Remote file path on the Android device (e.g. "/sdcard/Download/config.json", "/data/local/tmp/app.log"). |
device | string | Device serial/identifier. Defaults to sticky target device. |
maxLines | integer | Maximum number of lines to read (default: 500). |
create_directory Create directory on device
Creates a directory path recursively on the Android device filesystem ("mkdir -p").
| Parameter | Type | Description |
|---|---|---|
path * | string | Remote directory path to create on device (e.g. "/sdcard/MyFolder"). |
device | string | Device serial/identifier. Defaults to sticky target device. |
delete_file Delete file or directory on device
Deletes a file or directory recursively on the Android device ("rm -rf").
| Parameter | Type | Description |
|---|---|---|
path * | string | Remote file or directory path to delete. |
device | string | Device serial/identifier. Defaults to sticky target device. |
move_file Move or rename file on device
Moves or renames a file or directory on the Android device ("mv").
| Parameter | Type | Description |
|---|---|---|
destPath * | string | Destination path on device. |
sourcePath * | string | Source path on device. |
device | string | Device serial/identifier. Defaults to sticky target device. |
push_file Push file or directory to device
Transfers a local file or directory from the host machine to a path on the Android device.
| Parameter | Type | Description |
|---|---|---|
localPath * | string | Absolute or relative path to the source file/directory on the host machine. |
remotePath * | string | Destination path on the Android device (e.g. "/sdcard/Download/file.txt" or "/data/local/tmp/"). |
device | string | Device serial/identifier. Defaults to sticky target device. |
pull_file Pull file or directory from device
Transfers a file or directory from the Android device to the host machine filesystem.
| Parameter | Type | Description |
|---|---|---|
localPath * | string | Destination file or directory path on the host machine. |
remotePath * | string | Source path on the Android device (e.g. "/sdcard/Download/test.txt" or "/data/local/tmp/app.log"). |
device | string | Device serial/identifier. Defaults to sticky target device. |
execute_shell_command Execute shell command on device
Executes an arbitrary ADB shell command on the target Android device and returns its standard output.
| Parameter | Type | Description |
|---|---|---|
command * | string | Shell command string to execute (e.g. "ls -la /sdcard", "getprop ro.build.version.release", "df -h"). |
device | string | Device serial/identifier. Defaults to sticky target device. |
timeoutMs | integer | Execution timeout in milliseconds (default 15000). |
tap_by_text Tap UI element by visible text
Locates a UI element matching visible text, calculates its center bounds, and dispatches a touch tap. Eliminates manual coordinate extraction.
| Parameter | Type | Description |
|---|---|---|
text * | string | Visible text on the button, label, or view to tap. |
device | string | Device serial/identifier. Defaults to sticky target device. |
tap_by_id Tap UI element by resource-id
Locates a UI element matching an Android resource-id (e.g. "btn_submit", "com.example:id/save"), calculates center bounds, and taps it.
| Parameter | Type | Description |
|---|---|---|
resourceId * | string | Resource ID of the target element to tap. |
device | string | Device serial/identifier. Defaults to sticky target device. |
assert_ui_element Assert UI element visibility
Verifies whether an element with matching text, resource-id, or content-desc currently appears on the device screen.
| Parameter | Type | Description |
|---|---|---|
contentDesc | string | Accessibility content description to match. |
device | string | Device serial/identifier. Defaults to sticky target device. |
resourceId | string | Resource-id to match. |
text | string | Text to match. |
list_cloud_devices List Android Device Streaming cloud devices
Lists remote physical devices (Pixel, Galaxy, foldables) available for cloud streaming via the Android CLI.
start_cloud_device_stream Start Android Device Streaming session
Reserves and connects to a remote physical device in Google Cloud over an ADB-over-SSL tunnel.
| Parameter | Type | Description |
|---|---|---|
deviceModel * | string | Cloud device model or ID (e.g. "Pixel 10 Pro", "Pixel 9", "Galaxy S24"). |
project | string | Google Cloud / Firebase project ID if not configured globally. |
stop_cloud_device_stream Stop Android Device Streaming session
Releases a cloud device reservation session started via Android CLI.
| Parameter | Type | Description |
|---|---|---|
sessionIdOrDevice * | string | Active session ID or device identifier to stop. |