> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xenoci.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tap and type

> box ui reads the elements on the simulator screen and taps, types and swipes in the app

> [!NOTE]
>
> **When to use it.** Your agent has to reach a screen behind a button, fill a field or check what is on screen without reading pixels. `box ui` lists what is on the simulator screen and taps, types and swipes in the app

## Run it

```bash theme={"system"}
box ui describe
```

<video controls muted loop playsInline autoPlay preload="metadata" poster="/media/docs/ios-ui-poster.webp" src="https://mintcdn.com/xenoci/ZFKGlbE4Q2bw14Om/media/docs/ios-ui.mp4?fit=max&auto=format&n=ZFKGlbE4Q2bw14Om&q=85&s=d9fe07b1fa407193c49e4ba5174d7674" width="1280" height="778" />

box ui describe lists the screen, box ui tap --id add presses Add, box ui find shows 4 items

Each line is one element: its role, label, value and the ref `tap --id` takes. This is what box printed for [SwiftieDev/SwiftUI-ToDos-App](https://github.com/SwiftieDev/SwiftUI-ToDos-App) (MIT); the lines without a label are left out

```text theme={"system"}
box: queue: job bj_Wgh5VhLfo5ld5SQm (ui, ios, $0.05/min) submitted
[box] 19:21:38 launch com.swiftiedev.ToDos (appearance light)
[box] 19:21:44 app screen ready (4s)
[box] 19:22:02 ui describe rc=0
box: bj_Wgh5VhLfo5ld5SQm succeeded, 120s billed, $0.10
AXApplication "ToDos"
AXGroup ref=Reminders
AXButton "Add Section"
AXHeading "Reminders"
AXHeading "My Lists"
AXStaticText "No Reminders"
AXImage "Bulleted List In A Portrait Rectangle" ref=list.bullet.rectangle.portrait
AXStaticText "Start adding reminders to see your list."
AXButton "Add Reminder"
AXGroup "Toolbar" ref=Toolbar
```

![The ToDos home screen box described: Reminders, My Lists, No Reminders and the Add Reminder button](https://mintcdn.com/xenoci/ZFKGlbE4Q2bw14Om/images/docs-feature-ui.png?fit=max\&auto=format\&n=ZFKGlbE4Q2bw14Om\&q=85\&s=f4d29fa01fae4f8a7bd3240413e5b965)

The screen box saved with that job, made smaller for this page. Then tap an element by its label

```bash theme={"system"}
box ui tap --label "Add Reminder"
```

```text theme={"system"}
box: queue: job bj_Ijt9MjfkE6ycfPwK (ui, ios, $0.05/min) submitted
[box] 19:24:11 app screen ready (11s)
[box] 19:24:19 ui tap rc=0
[box] 19:24:21 screenshot box-out/screen.png
box: bj_Ijt9MjfkE6ycfPwK succeeded, 120s billed, $0.10
```

## Commands

* `box ui describe` lists the elements, `--tree` nests them under their parent, `--json` prints all fields
* `box ui find TEXT` prints the one element whose label, value or ref contains TEXT
* `box ui tap --label TEXT`, `--id REF` or a point `X Y`
* `box ui type "text"` types into the focused field
* `box ui swipe X1 Y1 X2 Y2`, `box ui button home` (or lock, side, siri)
* `box ui screen out.png` saves a picture of the screen

Start with [`box run`](https://docs.xenoci.com/ios/run) to keep the app open between commands


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.