Wait For Element
android_wait_for_elementWait for a UI element to appear using text, resource ID, or class name. Returns element info and coordinates, replacing fixed sleeps for dynamic content.
Instructions
Wait until a UI element appears on screen. Use this instead of a fixed sleep when content loads dynamically. Returns element info and center coordinates when found.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Match by exact visible text | |
| 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. Defaults to 10. | |
| 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) |