wait_for_text
Polls the Android UI until an element with given text appears and returns its tappable center. Replaces blind wait-then-screenshot for async actions like network loads or navigation.
Instructions
Poll the UI until an element with the given text/content-description appears (or times out), then return it. Use this after an async action (network load, navigation, animation) instead of a blind wait-then-screenshot — it returns as soon as the element is present, with its tappable center. Note: canvas-drawn (RN/Skia) text never enters the hierarchy, so it will time out on those — screenshot instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text or content-description to wait for. | |
| scroll | No | When true, swipe upward through the current scroll container while polling. Useful when Android omits off-screen ScrollView content from the accessibility tree. | |
| serial | No | Target device serial (adb -s). Optional when exactly one device is attached. | |
| partial | No | Substring match instead of exact. Default true. | |
| timeout_s | No | How long to wait, in seconds. Default 15. |