# box > box builds, tests and screenshots iOS apps for coding agents (Claude Code, Codex, Cursor) running on Windows, Linux or macOS; iOS runs on a real Mac. Two project folders run at once, each on its own simulator; a third waits. Prepaid, per minute of build and test time, GitHub sign-in. First GitHub sign-in adds $10 of credit, good for 1 year (about 200 iOS minutes). box proof compares a base snapshot with the working tree at named checkpoints and creates a shareable visual report. This file is enough to install box, sign in, build and get results without reading anything else. The longer runbook with every case is https://docs.xenoci.com/setup.md (plain markdown; read it from step 1); the user's line is "Set up XenoCI Box with https://docs.xenoci.com/setup". ## Rules for agents - Show the user each command you run. Nothing here needs sudo or administrator rights; box writes only ~/.local/bin/box and ~/.config/box/ (Windows: %USERPROFILE%\.local\bin\box.exe and %APPDATA%\box\). - Never ask the user to paste a box token, API key, GitHub code or password into the chat, and never commit one. - Money and GitHub approval are the user's. Never top up, pay or approve on their behalf; ask once, then hand them the link. - Exit code 3 is not a retry signal: show the message and stop. Exit code 4 means "not signed in": go to Sign in. - Never commit the .box/ folder (job results land in .box/out//). Keep .box/setup if the project has one. ## 1. Install Linux, macOS, WSL: ```sh curl -fsSL https://xenoci.com/install.sh | sh export PATH="$HOME/.local/bin:$PATH" box --version ``` Windows (PowerShell; from cmd: `powershell -ExecutionPolicy Bypass -c "irm https://xenoci.com/install.ps1 | iex"`): ```powershell irm https://xenoci.com/install.ps1 | iex box --version ``` With Node: `npm install -g --prefix ~/.local @xenoci/box@latest`, or run without installing: `npx -y @xenoci/box@latest `. Run the install line even if box is already there: it also updates an old box, and an old box answers `cli_update_required (410)` at sign-in. Then `box --version` must name the new version; if it does not, another older box comes first on PATH (`which -a box`), so put `$HOME/.local/bin` first. Expect `box `. `this OS is not supported` or `this CPU is not supported` (exit 2): box needs Windows, Linux, WSL or macOS on x64 or arm64; stop. `download failed` or `checksum mismatch` (exit 3): run the line once more, then stop and show the output. `box: command not found`: the `export PATH` line was skipped. ## 2. Sign in (GitHub) ```sh box status ``` Signed in: lines `login`, `balance`, `running`, exit 0. Go to 3. Not signed in (exit 4): 1. `box login --no-browser` prints `box: Open https://xenoci.com/login?code=XXXX-XXXX ...` and returns. 2. Give the user that link in one message ("Open it and press Continue with GitHub; I'll carry on by myself"). Do not wait for a reply. 3. Run `box login --no-browser --wait` right away. It returns `box: signed in as ` when they finish, or after about 110 s with `still waiting for sign-in` (exit 4): run it again, up to 10 times; the link lasts 15 minutes. `The sign-in link expired`: start again at 1. 4. `box status` exit 0 means done. No browser at all (CI, a cloud agent): the user runs `box key create --name ` on a signed-in machine and sets the value as `BOX_API_KEY`; then no `box login` is needed. `box key list` and `box key delete ` manage keys. GitHub sign-in only identifies the user; box gets no access to their repositories. ## 3. Connect the agent (once per machine) ```sh box setup ``` Adds the box skill, a box section in ~/.claude/CLAUDE.md and ~/.codex/AGENTS.md, and the box MCP server for Claude Code and Codex; running it again changes nothing. `box setup --project` writes the notes, skills and a Cursor rule into one repository instead. Any other MCP client: `npx -y @xenoci/box mcp` (stdio; `box mcp` when installed). MCP tools appear after the agent restarts; until then use the CLI. Plugins: `claude plugin marketplace add Xeno-CI/box-cli` ([plugins](https://github.com/Xeno-CI/box-cli)). ## 4. Build, test, screenshot Run from the project root (the folder with the .xcodeproj, .xcworkspace, project.yml, Package.swift or ios/). ```sh box build --dry-run # the files that would be sent; check no secret is listed (.env and .gitignore'd files never are) box build # simulator build; --device-build: unsigned Release build (device-build.zip) box test # build and run the tests on a fresh simulator; --only-testing box test --screenshot # tests, then launch the app and save screen.png in the same job box screenshot out.png # build, launch, save a picture; --dark, --locale ko_KR, --record (screen.mp4), --compare last ``` Every job uploads only what changed and prints one `box: : ...` line per step (upload, queue, machine, cache, build, test, results), then `box: succeeded, s billed` (exit 0). Results are in .box/out//: screen.png, logs, test.log, test.xcresult.zip, the app. Common options: `--scheme`, `--configuration`, `--workspace path/App.xcodeproj`, `--device ` (`box devices` lists them; default iPhone 17), `--timeout `, `--detach` (return the job id at once), `--json` (one JSON event per line). A `.box/setup` bash script at the project root runs on the build machine before `box build`, `box test` and `box run`, once until its contents change; a failing script stops the build before it starts. Not for secrets. Later: `box jobs` (recent jobs), `box logs [job]` (follow a job again), `box results [job]` (download results again without rerunning), `box cancel [job]`. ## 5. A live app session ```sh box run # build and keep the app open on this folder's simulator box ui describe # one line per element: role, label, value, ref box ui tap --label "Sign in" # or --id , or a point: box ui tap 120 640 box ui type "hello" # into the focused field box ui swipe 200 700 200 200 box ui button home # home, lock, side, siri box ui screen now.png # a picture of the screen right now box stop # end the session (or a job: box stop ) ``` `box debug` launches the app under LLDB, stops at breakpoints and prints the stack and variables (iOS). `box exec -- ` runs a shell command in the project folder on the build machine; files written to "$BOX_OUT" come back to .box/out//. `box web ` opens a page in Safari on a Mac and on an iPhone simulator (`--serve "npm run dev" --port 3000` for a dev server). `box ship` uploads a signed Release build to TestFlight with the user's App Store Connect API key. MCP has the same as tools: build, test, screenshot, run, debug, describe, find, tap, type, swipe, press_button, look, stop, exec, devices, web, ship, logs, why, status, usage, login, topup, report_job, claims, report_problem, ai. ## 6. Price and balance - iOS $0.05 per minute, each started minute rounded up (1 to 60 s is one minute). Upload, queue time, machine start-up and failures on our side are not billed. - A job holds its first minute before it starts and pays only the minutes it ran. - `box status` shows the balance and about how many build minutes it buys; a `low` line appears under $1. `box balance` lists top-ups and charges, `box usage` lists jobs (`--csv` for a file). - Top-ups are prepaid in US dollars, at least $5 in steps of $1, plus a 5.5% service fee (at least $0.80). One account holds at most $300. No subscription and no card on file. ## 7. When the balance runs out: hand the user a payment link A job refused for the balance exits 3 with `box: Your balance is empty. Ask the user once whether to make a top-up link ...` and the link; nothing is billed. Then: 1. Ask the user once, for example: "box has $0.40 left. Shall I make a top-up link?" If they say no, stop asking and carry on with what the balance allows. 2. If yes: `box topup --print` prints the top-up link (opens nothing). Give it to the user; they pay in the browser. 3. Run `box topup --wait`. It returns `box: balance is now $...` when the payment lands; after about 110 s without it, run it again without asking. 4. Run the refused command again. MCP: the topup tool returns the link; call it again with wait_seconds (up to 50) until the balance goes up. ## 8. Errors and what to do Exit codes: 0 succeeded; 1 the job failed (the app's build or tests); 2 a usage error, fixed by changing the command or the folder; 3 box, the network or the balance, show the message and do not loop; 4 not signed in; 130 cancelled. - `box: N compile error(s):` with file:line:col lines (exit 1): real errors in the user's code. Fix them and run again. - A failed job ends with `box: details: .box/out//why.txt`: read it and the why-*.png pictures beside it first (crash stacks with symbols, failing tests with file:line, the screen at the failure). `box: ai: ` is the one-line answer; `box why [job]` prints where, why and fix. - `This folder has no ... app project at its top` (exit 2, nothing uploaded or billed): run from the app folder, pass `--workspace path/App.xcodeproj`, or run the project's own tool with `box exec -- `. Rust and Bun are not on the Mac image: install them in the same `box exec`. node_modules is never uploaded: run `npm ci` in the same `box exec`. - `no scheme found`: pass `--scheme `. - `You are not signed in` (exit 4): section 2. `Your sign-in expired or was revoked`: `box login` again. `The box server refused the token in BOX_TOKEN`: the user makes a new one. - `Your balance is empty` (exit 3): section 7. - `Too many requests to box right now. Wait N s`: wait that long, then run once more. - `network_error` or a lost connection: a started job keeps running; `box status` shows it and `box logs` follows it. - `is already linked to another box account`, `This box account is turned off`: tell the user; they write to play@xenoci.com. - A third folder's `box run` waits while two run; it does not stop them. `box stop` in another folder frees a simulator. - A failed job that ends with `box: looks like our side` (the Mac, a time limit, a lost connection) or a wrong charge: `box report --reason "..."` (MCP report_job) for a refund; `box claims` shows refunded or declined. Not for the app's own compile or test failures. - `box ai off` stops sending failed logs and screens to the AI models for the account (on by default, [terms 6-1](https://docs.xenoci.com/about/box-terms#ai)). ## Docs - [Agent runbook](https://docs.xenoci.com/setup.md): install the CLI, sign in with GitHub, first build, test and screenshot (plain markdown) - [Docs](https://docs.xenoci.com): what box is and what works today - [Quickstart](https://docs.xenoci.com/quickstart): install, sign in, first build and screenshot - [Test before every push](https://docs.xenoci.com/ios/pre-push): `box setup --pre-push` adds a git pre-push hook that runs `box test` and stops the push when the tests fail - [Agents](https://docs.xenoci.com/agents): Claude Code, Codex, Cursor, cloud agents with BOX_API_KEY, the MCP tools - [Commands](https://docs.xenoci.com/reference/commands): every command and option - [Exit codes](https://docs.xenoci.com/reference/exit-codes) - [Pricing](https://docs.xenoci.com/reference/pricing) - [Support](https://docs.xenoci.com/support): box feedback, refunds for failed jobs, mail - [Guides](https://docs.xenoci.com/guides): answers to the questions people ask about building and testing an iOS app from Linux or Windows - [Status](https://status.xenoci.com) - [Terms](https://docs.xenoci.com/about/box-terms)