iOS Simulator: Wait For Element
ios_simulator_wait_for_elementPoll the iOS Simulator UI tree until an element appears or disappears, with configurable timeout and interval. Use it to wait out loading states, network requests, or long imports.
Instructions
Poll until an element appears, or until it goes away. This is the tool for a screen that loads: a generation step, a network round trip, a long import. settle_ms on the action tools is a pause for an animation and caps at ten seconds — it is not a wait, and using it as one is how you end up verifying a server instead of the screen. Give exactly one of id, label or predicate, the same way ios_simulator_tap_element takes them. Your MCP client may have a request timeout of its own, commonly 60 seconds, and it will cut this call off before timeout_ms does — for a longer wait, raise it there too or call this twice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Accessibility identifier — the `id` field from ios_simulator_ui_tree. | |
| label | No | Exact accessibility label, i.e. the visible text. Matched against controls first, as in ios_simulator_tap_element. | |
| absent | No | Wait for the element to *stop* matching instead of to start. This is how you wait out a spinner, a progress view or a placeholder, which is the same wait from the other side. | |
| device | No | Which simulator: its UDID or its name as shown by ios_simulator_list. Omit it when exactly one is booted — that is the normal case, and IOS_SIMULATOR_ID pins it when it is not. Unlike simctl's own `booted`, this never picks arbitrarily between two. | |
| poll_ms | No | How long to wait between polls. Each poll is one query to the device, so a long wait costs less at 2000 than at 250 and arrives at almost the same moment. | |
| predicate | No | A raw NSPredicate, e.g. `type == "XCUIElementTypeButton" AND label BEGINSWITH "Add"`. | |
| screenshot | No | Return a screenshot of the resulting screen. On by default, and worth leaving on: it is how you find out that the action landed where you meant it to. Turn it off only for a sequence whose intermediate states you do not need to see. | |
| timeout_ms | No | How long to keep polling before giving up. Read the note about your client's own request timeout in this tool's description before setting it above 60000. |