# simulator_tap

> The MCP tool that taps or long-presses the Team's Simulator's screen, at a point or on an element named by a selector.

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

`simulator_tap` taps the Team's running Simulator's screen, in one of two ways. Give exactly one:

- **Coordinates**: `x` and `y`, in [screen coordinates](https://air.build/docs/mcp-tools/simulator_screen/#coordinates). The tap goes there at once, whatever is under it.
- **An element**: a selector, any of `text`, `id`, `value`, `role` and `nodeId` from [simulator_describe_ui](https://air.build/docs/mcp-tools/simulator_describe_ui/) or [simulator_find](https://air.build/docs/mcp-tools/simulator_find/) (see [Selectors](https://air.build/docs/mcp-tools/simulator_find/#selector)). The tool waits, up to `timeoutSeconds`, for a matching element that is enabled and holds still, then taps it (its center, or the point iOS gives for controls like switches). It does not scroll: bring the element on screen first with [simulator_scroll_to](https://air.build/docs/mcp-tools/simulator_scroll_to/).

`duration` holds the finger down: a long press. The tool does not check what the tap did; look with [simulator_describe_ui](https://air.build/docs/mcp-tools/simulator_describe_ui/) or wait for the result with [simulator_wait](https://air.build/docs/mcp-tools/simulator_wait/).

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

## 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) |
| `x` | number, -100000 to 100000 | With `y` | — | Where to tap, across |
| `y` | number, -100000 to 100000 | With `x` | — | Where to tap, down |
| `text`, `id`, `value`, `role`, `nodeId`, `exact`, `strict` | see [Selectors](https://air.build/docs/mcp-tools/simulator_find/#selector) | Instead of `x`, `y` | — | The element to tap |
| `duration` | number, 0 to 60 | No | A plain tap | Seconds to hold: a long press |
| `timeoutSeconds` | number, 0 to 600 | No | `10` | With a selector: how long to wait for the element |
| `display` | string | No | The display in use | With coordinates, on a foldable: the display's `screenId` from [simulator_displays](https://air.build/docs/mcp-tools/simulator_displays/) |

## Result

With coordinates:

| Field | What |
| --- | --- |
| `ok` | `true` |

With a selector:

| Field | What |
| --- | --- |
| `ok` | `true` |
| `element` | The element tapped (fields as in [simulator_find](https://air.build/docs/mcp-tools/simulator_find/#result)) |
| `point` | `x`, `y`: where the tap landed |
| `exact` | Whether its text equals the query |
| `matchCount` | How many usable elements matched; more than 1 means the ranking chose |
| `excluded` | Elements that matched but were left out, with `reason` |
| `elapsedMs` | When the wait took more than one round: how long it waited, in milliseconds |

```json
{
  "ok": true,
  "element": { "label": "New note", "identifier": "new-note", "role": "AXButton",
               "frame": { "x": 16, "y": 120, "width": 370, "height": 52 }, "enabled": true, "interactive": true, "adjustable": false },
  "point": { "x": 201, "y": 146 },
  "exact": true,
  "matchCount": 1,
  "excluded": []
}
```

## Errors

| Message | When | What to do |
| --- | --- | --- |
| Give both x and y. | Only one coordinate | Send both |
| Give coordinates or a selector, not both. | Coordinates and selector fields together | Send one or the other |
| Name the element: text, id, value, role or nodeId. | Neither coordinates nor a selector | Send one |
| no usable element matching _selector_ within _n_s | Nothing usable matched in time | See [selector errors](https://air.build/docs/mcp-tools/simulator_find/#selector) |

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_tap", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "id": "new-note"}}
```
