tap_element
Tap an Android element by its resource id, re-resolving it immediately before the click so stale coordinates on overlays are avoided. Supports exact or substring id matching and optional UI-change verification.
Instructions
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).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| serial | No | Target device serial (adb -s). Optional when exactly one device is attached. | |
| partial | No | Substring match instead of exact. Default true. | |
| resource_id | Yes | Resource id to find and tap, e.g. "com.example.app:id/submit_button" or just "submit_button" (matches by substring by default). | |
| verify_change | No | Also report whether the UI hierarchy changed after the tap (ui_changed: true/false). Costs two extra hierarchy reads (~2-3s); use when a tap silently doing nothing would send you down the wrong path. | |
| via_accessibility | No | EXPERIMENTAL. Dispatch a real accessibility click (AccessibilityNodeInfo.performAction(ACTION_CLICK)) through the adb-mcp accessibility bridge instead of a coordinate tap — reaches native views (Compose/RN NativeTabs bars, some overlays) that ignore input tap entirely. Requires the bridge installed once per device: run "adb-mcp bridge install" on the host first, or this returns a clear error telling you to. Default false (coordinate tap). |