# simulator_wait

> The MCP tool that waits until an element appears or disappears on the Team's Simulator, or until the screen stops changing.

Source: https://air.build/docs/mcp-tools/simulator_wait/

`simulator_wait` waits on the Team's running Simulator until something happens on screen, then answers:

- `visible`: until an element matching the selector is on screen (a disabled element counts as visible);
- `hidden`: until no element matches it any more;
- `idle`: until the screen's accessibility tree has not changed for `stableSeconds`. Use it after an action that animates or loads. A spinner alone does not change the tree, so it counts as idle.

It touches nothing and is read-only. The selector is described in [Selectors](https://air.build/docs/mcp-tools/simulator_find/#selector); `idle` takes none.

| Read-only | Destructive | Idempotent |
| --- | --- | --- |
| Yes | No | Yes |

## Inputs

| Input | Type | Required | Default | What it does |
| --- | --- | --- | --- | --- |
| `teamId` | string (UUID) | Yes | — | The Team, from [list_teams](https://air.build/docs/mcp-tools/list_teams/) |
| `simulator` | string | No | The Team's default device | Which device, by `id` from [list_simulators](https://air.build/docs/mcp-tools/list_simulators/#result) |
| `state` | string: `visible`, `hidden` or `idle` | Yes | — | What to wait for |
| `text`, `id`, `value`, `role`, `nodeId`, `exact`, `strict` | see [Selectors](https://air.build/docs/mcp-tools/simulator_find/#selector) | With `visible` and `hidden` | — | The element |
| `timeoutSeconds` | number, 0 to 600 | No | `10` | How long to wait |
| `stableSeconds` | number, 0 to 10 | No | `0.5` | With `idle`: how long the screen must stay unchanged |

## Result

| Field | What |
| --- | --- |
| `ok` | `true` |
| `state` | `visible`, `hidden` or `idle` |
| `elapsedMs` | How long it waited, in milliseconds |
| `element`, `point`, `exact`, `matchCount`, `excluded` | With `visible`: the element found, as in [simulator_tap](https://air.build/docs/mcp-tools/simulator_tap/#result) |

```json
{ "ok": true, "state": "hidden", "elapsedMs": 1250 }
```

## Errors

| Message | When | What to do |
| --- | --- | --- |
| state must be one of visible, hidden, idle. | `state` is missing or another value | Send one of the three |
| no usable element matching _selector_ within _n_s | `visible`: it did not appear in time | Wait longer, or check the selector with [simulator_find](https://air.build/docs/mcp-tools/simulator_find/) |
| element _selector_ disappearing did not happen within _n_s | `hidden`: it was still there | Wait longer |
| UI settling for _s_s did not happen within _n_s | `idle`: the screen kept changing | Wait longer, or use a selector instead |

Plus the other [selector errors](https://air.build/docs/mcp-tools/simulator_find/#selector), and the errors every Simulator tool can return: see [start_simulator](https://air.build/docs/mcp-tools/start_simulator/#device-errors).

## Example

```json
{"name": "simulator_wait", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "state": "visible", "text": "Saved", "timeoutSeconds": 30}}
```
