interacting-with-android-device
БесплатноБез исполняемых скриптовНе проверенInstructions for capturing UI state, comparing with mocks, and interacting with an Android device using MCP tools backed by ADB.
от bitwarden★ 9 728 звёзд на GitHubОб этом скилле
Interacting with Android Device
Quick Start: MCP Tools
The android-device MCP server provides 6 tools for device interaction. These replace the previous shell scripts with proper XML parsing, structured dumpsys parsing, and native obstruction detection.
Available tools:
capture— Capture UI hierarchy XML and/or screenshot. Params:{ xml?: boolean, screenshot?: boolean }. Default: both.find_element— Find element bytextorcontent-desc, return coordinates with obstruction detection. Params:{ text: string }. Returns JSON with coordinates, bounds, and obstruction status.tap_at— Tap at specific coordinates, wait, capture screenshot. Params:{ x, y, waitSeconds? }.tap_element— Find, tap, and capture in one call (recommended). Params:{ text, waitSeconds? }. Auto-adjusts coordinates when obstructed.navigate— Navigation actions: home, back, app-drawer. Params:{ action, waitSeconds? }. Captures screenshot after action.input_text— Type text into the focused field. Params:{ text, clear? }. Setclear: trueto erase existing content first.
Use these MCP tools instead of raw ADB commands to save tokens, get structured results, and benefit from automatic obstruction detection.
1. Capturing Current State
To understand what is currently on the device, use the capture tool:
- It saves
view.xml(UI hierarchy) andscreen.png(screenshot) to the working directory - Read
view.xmlto find coordinates (bounds) and properties (liketextorresource-id) of UI elements - Use
screen.pngfor visual verification against design mocks
2. Interacting with the Device
Using MCP Tools (Recommended)
Find and tap an element by text — use
tap_element: This finds the element, detects obstructions, taps (with adjusted coordinates if needed), and captures a screenshot — all in one call.Tap at specific coordinates — use
tap_at: When you already have coordinates fromfind_elementor manual inspection.Navigate (home, back, app-drawer) — use
navigate: Performs the action and captures a screenshot.Find element without tapping — use
find_element: Returns coordinates and full element info. Useful when you need to inspect before acting.Type text into a field — use
input_text: Types text into the currently focused field. Setclear: trueto erase existing content first. Tap the field before calling this if it isn't already focused.
Raw ADB Commands (When MCP Tools Aren't Sufficient)
- Key Events:
- Back:
adb shell input keyevent 4 - Home:
adb shell input keyevent 3 - Enter:
adb shell input keyevent 66
- Back:
- Scrolling/Swiping: Use
adb shell input swipe <x1> <y1> <x2> <y2> <duration_ms>where:(x1, y1)= starting point(x2, y2)= ending pointduration_ms= duration in milliseconds (1000ms is typical; adjust for speed/distance)- Note: For expanding containers/drawers, use large distances (e.g., 2400->300 for a 2992px tall screen)
3. Obstruction Detection
The find_element and tap_element tools automatically detect when another element would intercept the tap. This catches:
- System overlays (Layer 1): TalkBack floating menu, PiP windows, accessibility services — detected via
dumpsys window windowstouchable regions - In-app elements (Layer 2): FABs, dialogs, bottom sheets, snackbars — detected by finding the topmost clickable element at the tap point in the UI hierarchy
When obstruction is detected:
- Coordinates are auto-adjusted to the center of the largest unobstructed strip (top/bottom/left/right of the obstructor)
- The response includes the obstructor identity, bounds, and visible region info
- If fully obscured (no visible region), the original center is returned as best-effort
- Compose parent wrapper pattern (identical bounds) is recognized as non-obstruction
4. Verification Workflow
Follow these steps for a complete UI test:
- Build and Install: Ensure the latest version of the app is running:
./gradlew installDebug. - Inspect: Use
captureto dump the UI hierarchy and take a screenshot. - Compare: Check the current UI against any mock image files in the project.
- Interact: Use
tap_elementto tap a UI element by text. The tool handles coordinate calculation and obstruction detection automatically. - Verify: Use
captureagain to confirm the UI has updated as expected (e.g., a new screen is shown, or a success message appeared).
5. Examples
Example: Navigate to Settings and Check for Updates
# Go to home screen
navigate({ action: "home" })
# Open app drawer
navigate({ action: "app-drawer" })
# Find and tap through settings
tap_element({ text: "Settings", waitSeconds: 2 })
tap_element({ text: "System", waitSeconds: 2 })
tap_element({ text: "Software updates", waitSeconds: 2 })
tap_element
Установить interacting-with-android-device в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
mcp__android-device__capturemcp__android-device__find_elementmcp__android-device__tap_atmcp__android-device__tap_elementmcp__android-device__navigatemcp__android-device__input_textBash(adb:*)Bash(sleep:*)Bash(./gradlew install*:*)ReadGlobFAQ
Что делает скилл interacting-with-android-device?
Instructions for capturing UI state, comparing with mocks, and interacting with an Android device using MCP tools backed by ADB.
Как установить скилл interacting-with-android-device?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл interacting-with-android-device запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic