> ## 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.

# Run the app

> box run builds the app and keeps it open on an iPhone simulator until you stop it

> [!NOTE]
>
> **When to use it.** You want the app to stay open after the build, so you can watch it or have your agent act on it with `box ui`. One job builds the app, installs it on an iPhone simulator, launches it and keeps it open with a live view in your browser

## Run it

```bash theme={"system"}
box run --detach
```

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

The live view of a box run session while items are added

`--detach` returns the job id right away so your agent can go on; without it box follows the log. This is what box printed for [SwiftieDev/SwiftUI-ToDos-App](https://github.com/SwiftieDev/SwiftUI-ToDos-App) (MIT); the Xcode lines between are left out

```text theme={"system"}
box: queue: job bj_4Dp-laBEjRH8View (run, ios, $0.05/min) submitted
box: live view: https://xenoci.com/live/bj_4Dp-laBEjRH8View (sign in with this GitHub account; it closes when the session ends)
[box] 19:14:01 simulator boot C2224F16-C641-430A-9B04-01C206C62A10
[box] BOX_BUILD_SECONDS=24 rc=0
[box] 19:14:25 simulator ready (waited 0s)
[box] 19:14:33 install com.swiftiedev.ToDos
[box] 19:14:50 launch com.swiftiedev.ToDos (appearance light)
[box] 19:15:11 BOX_SESSION_READY live view is on; it ends after 10 minutes without a screen change, 30 minutes in all, or box stop
```

When `BOX_SESSION_READY` appears the app is open. Open the live view address while signed in with the same GitHub account to watch the simulator screen

![The ToDos example app open on an iPhone simulator, as box saved it](https://mintcdn.com/xenoci/ZFKGlbE4Q2bw14Om/images/docs-feature-screenshot.png?fit=max\&auto=format\&n=ZFKGlbE4Q2bw14Om\&q=85\&s=46f0eb04e82494cde743c8f38d765deb)

The first screen of the same app, saved by `box screenshot`, made smaller for this page

## How it ends

* `box stop` closes the session and the billing stops
* It also ends after 10 minutes without a screen change, after 30 minutes in all, or at the next `box build`, `box test` or `box run` in this folder
* Two folders can keep a session open at once; a third waits

Options: `--device`, `--dark` and `--locale` as for [screenshots](https://docs.xenoci.com/ios/screenshot.md)


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