All three tools require Facebook idb to be installed. idb provides the
describe-all command that reads the live iOS accessibility tree. Without idb, simulator_snapshot returns an install prompt and suggests simulator_accessibility_audit as a fallback.simulator_snapshot
Captures a structured accessibility snapshot of the current simulator screen and returns it as formatted text. This is the preferred way to understand UI state — no vision model required. Analogous to Playwright’sbrowser_snapshot.
Parameters
Device UDID, name, or
"booted". Defaults to the currently booted simulator.Accessibility tree output format
Each element in the snapshot is rendered on one line with the pattern:| Field | Description |
|---|---|
indent | Two spaces per nesting level — deeper elements are children of shallower ones |
role | iOS accessibility role from the element (Button, TextField, StaticText, Image, etc.) |
"label" | The element’s accessibility label — what VoiceOver reads |
val="..." | The element’s current value (shown only when different from label) |
@(x,y) | Top-left corner of the element in simulator screen points |
widthxheight | Element dimensions in simulator screen points |
Example snapshot output
Using snapshot coordinates for interaction
The@(x,y) coordinates in the snapshot are simulator screen points you can pass directly to simulator_tap, simulator_swipe, and simulator_long_press. To tap the center of an element, add half its width and height to the top-left coordinates.
Comparison with Playwright’s browser_snapshot
| Feature | Playwright browser_snapshot | Preflight simulator_snapshot |
|---|---|---|
| Output format | ARIA accessibility tree | iOS accessibility tree via idb |
| Element roles | ARIA roles (button, textbox) | iOS roles (Button, TextField) |
| Coordinate system | CSS pixels | Simulator screen points |
| No vision model needed | Yes | Yes |
| Works without idb | Yes (browser built-in) | No — idb required |
Return value
A formatted accessibility tree followed by a usage reminder:simulator_wait_for_element
Polls the accessibility tree repeatedly until an element matching your criteria appears, or until the timeout expires. Use this after navigation or async operations where you need to wait for a screen transition to complete before interacting. Analogous to Playwright’sbrowser_wait_for.
Parameters
Wait for an element with this accessibility label. Case-insensitive partial match —
"Sign" matches "Sign In" and "Sign Up".Wait for an element with this role, for example
"Button", "TextField", or "StaticText".Wait for an element containing this text in its label or value. Case-insensitive partial match.
Maximum wait time in milliseconds. Defaults to
10000 (10 seconds).How often to check the accessibility tree in milliseconds. Defaults to
500.Device UDID, name, or
"booted". Defaults to the currently booted simulator.At least one of
label, role, or text must be provided. You can combine multiple criteria — the element must match all of them.Return value
On success:isError: true on timeout.
Example
simulator_element_exists
Checks immediately whether an element matching your criteria is present on screen right now. Returns atrue or false result without polling or waiting. Use this for conditional logic — branching your automation based on what’s currently visible.
Parameters
Search for an element with this accessibility label. Case-insensitive partial match.
Search for an element with this role.
Search for an element containing this text in its label or value.
Device UDID, name, or
"booted". Defaults to the currently booted simulator.At least one of
label, role, or text must be provided.Return value
When found:Example
Complete workflow example
The following example shows all three tools working together to log in to an app, wait for the home screen, and verify a UI element — without using screenshots or a vision model.Snapshot the login screen
Start by taking a snapshot to understand what’s on screen and get element coordinates.The snapshot returns:
Tap Sign In and wait for the home screen
Tap the button and immediately wait for a known element on the home screen to appear.
simulator_wait_for_element polls every 500 ms. Once the home screen loads and the “Welcome” heading appears, it returns: