iOS tap by label
ios_tap_by_labelPREFERRED way to tap on iOS: find a UI element by its accessibility label and tap it in one call via the automation session. No coordinate math, and it works on zero-area elements (e.g. bottom-tab labels) where ios_tap(x,y) would miss. Use this before falling back to ios_tap with raw coordinates. If the element is off-screen it auto-scrolls to bring it into view first (disable with autoScroll:false). On no match, returns similar labels (incl. off-screen) to retry with. If neither the accessibility tree nor auto-scroll finds it, it falls back to reading the screen with OCR and taps the matching on-screen text; the reply says when OCR was used. Requires an active iOS automation session (auto-starts if needed). On a device set to direct-input-only it needs no session: it scrolls the element into view, reads the visible text on the screen to find where it is, taps there, and reports changed (whether the screen changed afterwards). That path needs the label to be visible text; an icon-only control fails fast, so use input:"session" for those.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| near | No | Direct-input path only: text of a neighbouring element, to pick between several look-alike labels. | |
| udid | Yes | iOS device UDID | |
| input | No | Input path. 'auto' (default) tries the direct input path first — the one that needs no automation session — and falls back to the session only when the direct path is not usable right now (the response says which one ran). On a device set to direct-input-only, an unusable direct path is reported as an error instead of silently switching to the session. 'hid' forces the direct path with no fallback, reporting 'no HID available' on iOS 17.x or with no tunnel. 'session' forces the automation session even when the direct path would have worked. | |
| label | Yes | Accessibility label or visible text of the element to tap | |
| match | No | How to match `label`. Default "contains" — strict, and the only modes that act without interpretation. "fuzzy" tolerates typos and word-order drift, and is tried ONLY after strict finds nothing; it REFUSES when two candidates are too close rather than guessing between them (e.g. "Sign" vs Sign In / Sign Out), and reports which attribute it matched. | |
| autoScroll | No | Scroll the element into view if off-screen before tapping (default: true) |