Android wait For
android_wait_forWait for text to appear or disappear on an Android device, polling OCR until condition met or timeout. Use to gate actions on UI state instead of fixed sleeps.
Instructions
Wait until text appears or disappears on a connected Android device or emulator, polling the OCR path (the same capture+OCR pipeline android_find_text uses) every ~600 ms until the condition holds or timeout_ms expires. A timeout is a normal matched:false answer, NEVER an error — use it to gate an action on a condition instead of looping android_find_text yourself or sleeping a guessed number of seconds. mode "appear" waits for the text to show up (a screen finished loading, a toast rendered); mode "disappear" waits for it to be gone (a spinner, a dialog). On a match, item carries the OCR text, confidence and pixel rect.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Wait for the text to appear (default) or disappear. | |
| text | Yes | Text to wait for (case-insensitive substring). | |
| serial | No | Target device serial from android_devices. Defaults to the currently streamed device, else the only connected one. | |
| timeout_ms | No | How long to poll before giving up, in milliseconds (default 8000, capped at 60000). | |
| min_confidence | No | Minimum recognition confidence 0..1 for a match (default 0.3). |