iOS find element
ios_find_elementFind a UI element on an iOS device by its accessibility label or text. Returns the element center coordinates (x, y), bounds, and which strategy matched. On no match, returns similar visible labels to retry with. Prefer this (or ios_tap_by_label) over eyeballing coordinates from a screenshot. Requires an active iOS automation session (auto-starts if needed). On a device set to direct-input-only it needs no session: it answers from the screen's accessibility tree in well under a second and returns the element's label, type, value and match score, but NO coordinates. Pass input:"session" to force the session lookup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Element type filter e.g. XCUIElementTypeButton, XCUIElementTypeCell (optional, used in class chain) | |
| udid | Yes | iOS device UDID | |
| input | No | Lookup path. 'auto' (default) follows the device's mode: direct-input-only devices look up without a session (no coordinates returned). 'session' forces the automation-session lookup, which returns coordinates. 'hid' forces the session-free lookup. | |
| label | Yes | Accessibility label or visible text of the element to find | |
| 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. | |
| strategy | No | Element finding strategy to try first. Defaults to trying class chain → predicate string → accessibility id → name → xpath in order. |