Download the exact captured file
---
name: box
description: Build, test, screenshot and drive an iOS app on a real Mac with the box CLI or its MCP tools. Use when the project is an iOS/Xcode project and this machine has no Xcode, or when the user mentions box.
---
# box
If `box` is not on this machine, install it first: `npm install -g --prefix ~/.local @xenoci/box@latest` (or run any command as `npx -y @xenoci/box@latest <command>`; without Node, `curl -fsSL https://xenoci.com/install.sh | sh` on Linux and macOS or `irm https://xenoci.com/install.ps1 | iex` in Windows PowerShell takes the same files from npm). No sudo or administrator; then `export PATH="$HOME/.local/bin:$PATH"` (Windows: open a new terminal, the installer adds box to the user PATH) and follow https://xenoci.com/agent.md from step 2.
box sends the project folder (changed files only, `.gitignore` respected, `.env` never sent) to a Mac and runs Xcode there.
1. `box status` - if it says to log in, run `box login`, give the user the link and code, and run `box login` again when they are done.
2. `box build --dry-run` shows what would be sent. `box build [--scheme S]` builds for the simulator.
3. `box test [--only-testing Target/Class/test]` runs tests. `box screenshot out.png` launches the app and saves a picture.
`--dark` and `--locale ko_KR|ja|ar|…` (ar, he: right to left) show it in dark mode or another language (also on `box run`
and `box ui`; the language changes only if the app lists it in CFBundleLocalizations or ships its .lproj, otherwise
only the region does); `--record` also saves a video of the screen (screen.mp4).
Compile errors are summarized as `file:line:col: message` with nearby lines, paths relative to the project.
4. `box run` builds and keeps the app open on a simulator (no `box build` before it: run builds). Then `box ui describe` lists what is on screen, one element per line
with its tap point; `box ui tap --id ID`, `box ui tap --label TEXT` or `box ui tap X Y`, `box ui type TEXT` (any language),
`box ui swipe X1 Y1 X2 Y2`, `box ui button home|lock|side|siri`, `box ui screen out.png`.
5. `box exec -- <cmd>` runs a shell command on the Mac. `box build --device-build` makes an unsigned device build zip.
`box debug --break File.swift:42 [--break increment] [--print count --print self.items[0].name] [--tap-label Add] [--stops 3]`
launches the app under LLDB and prints the stack and the variables at each breakpoint stop (debug.txt); `--tap-id`/`--tap-label`
taps an element after launch to reach code behind a button. It replaces the open `box run` session.
6. `box logs` follows the last job again; `box cancel` stops it (exit 130). Results are saved under `.box/out/<job>/`.
`--json` prints one JSON event per line, the last one `{"t":"result",…,"billed_seconds":…}`.
7. A problem with box itself (not your app): `box feedback "<what happened>"`.
Exit codes: 0 ok, 1 build or tests failed (read the errors, fix, run again), 2 bad usage or a local problem,
3 box's side or the account. Do not retry exit 3 in a loop; tell the user what the message says.
In cloud agents set the `BOX_API_KEY` secret instead of logging in. Never ask for a key in the chat or write it into the repo.
Full instructions: https://xenoci.com/setup