Tap Element
android_tap_elementTaps a UI element by selector instead of coordinates for reliable interaction with dynamic layouts. Waits for the element to appear, then taps its center.
Instructions
Find a UI element by selector and tap its center. More reliable than coordinate taps for dynamic layouts. Waits for the element to appear (default 5s).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "android_tap_element"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Match by exact visible text | |
| index | No | Which match to tap when multiple elements match (0-based). Defaults to 0. | |
| device | No | Device id (serial or host:port). Optional -- when omitted, uses ANDROID_MCP_DEVICE env or auto-selects the connected device (physical devices preferred over emulators). | |
| timeout | No | Max seconds to wait for the element. Defaults to 5. | |
| className | No | Match by class name, e.g. 'android.widget.Button' or just 'Button' | |
| resourceId | No | Match by resource id. Short ids like 'btn_login' are auto-expanded using the foreground app package | |
| contentDesc | No | Match by accessibility label / content description (substring, case-insensitive) | |
| textContains | No | Match by substring of visible text (case-insensitive) |