Android tap Text
android_tap_textFind and tap on-screen text via OCR for elements invisible to the view hierarchy, with optional expected-text confirmation.
Instructions
OCR the CURRENT screen and tap the center of the best text match — the same exact → case-insensitive-contains → candidate-list ambiguity rules as android_tap_element, for text the view hierarchy cannot see (Compose without semantics, Flutter, WebViews, game surfaces, badge counts, text baked into images). Prefer android_tap_element whenever the control HAS a resource-id or content-desc: identity beats pixels. On a real phone every tap has real consequences (posts, likes, purchases, messages): NEVER tap an unidentified control to find out what it does — if a control cannot be identified, STOP and report what you see. OCR boxes are image pixels and the tap is sent as center/screenshot-size, so no scale factor or rotation inverse is involved. After ~300 ms a fresh screenshot is captured with the same summary shape as android_interact. To CONFIRM the tap landed, pass expect_text (text that should appear) or expect_gone (text that should disappear) — the tool polls screen OCR and reports expected.matched in the SAME call. Do NOT screenshot-and-compare pixels to check whether a tap worked.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Text to tap, e.g. "同意并继续" or "Continue". Case-sensitive exact match first, then case-insensitive substring; several distinct matches raise a candidate-list error. | |
| serial | No | Target device serial from android_devices. Defaults to the currently streamed device, else the only connected one. | |
| expect_gone | No | Optional text that should DISAPPEAR after the tap. Mutually exclusive with expect_text; reported as expected.matched (true = the text is gone). | |
| expect_text | No | Optional text that should APPEAR after the tap. The tool polls screen OCR for up to ~4 s and reports expected.matched — one round trip instead of tap + screenshot + manual compare. | |
| min_confidence | No | Minimum recognition confidence 0..1 for a match (default 0.3). |