I run Claude Code and Codex on a Linux machine. For web and backend work that's fine. For iOS it breaks down fast: there's no Xcode on Linux, no simulator, so the agent writes Swift it can never compile, and I end up being the compiler, copying errors back and forth.

I built a small tool for that, called box. This post is about what I learned making a remote Mac useful to an agent, not to a human. (Disclosure: box is my product, it's paid, and the link is at the end.)

The loop the agent needs

A human can scroll through a 2,000-line xcodebuild log and find the one red line. An agent burns context doing that and often fixes the wrong thing. What worked better was making each build return something short and structured:

$ box build box: 1 compile error(s): App/Module0.swift:2:19: cannot convert value of type 'String' to specified type 'Int' 1 | import Foundation > 2 | let broken: Int = "x" 3 | struct Module0 { box: bj_5WO8cgwGaPXkXTit failed, 60s billed 

Tests come back the same way, as a count plus files the agent can open:

$ box test box: tests 3 passed, 0 failed box: saved ./.box/out/bj_f-P-JW-6hWjR-OnA/test-summary.json box: saved ./.box/out/bj_f-P-JW-6hWjR-OnA/test.xcresult.zip box: bj_f-P-JW-6hWjR-OnA succeeded, 180s billed 

Three things matter here:

  1. The error points at the local path. The build runs on a Mac, but the path in the error is the one in the agent's own checkout, so it can open the file directly.
  2. A few lines of context, not the whole log. Enough to fix the line without another round trip.
  3. The exit code means something. Exit code 1 means "fix the code". The agent doesn't have to guess whether the failure was the infrastructure or its own Swift.

Only send what changed

Each build sends only the files that changed (sync: 65 files, 1 new (3240 bytes) after a one-line edit). The workspace and build cache stay on the Mac between jobs, so there's no cache step to write. On a 70-file SwiftUI app, the first build took 15.9s and the build after a one-line change took 10.8s, with compiling on the Mac going from 7s to 2s and 70 Swift files compiled down to 3.

Letting the agent see the app

Compiling isn't the whole job. The agent also needs to look at what it built:

  • box screenshot returns a PNG; --dark --locale ar gives dark mode or another language, and --record saves the run as screen.mp4.
  • box run && box ui tap --label Add keeps the app open and taps, types, swipes or grabs the screen.
  • box run also gives a live view of the simulator in the browser that only your GitHub account can open.

Breakpoints the agent can read

The part I use most now is box debug. It launches the app under LLDB on the Mac, taps through to the code if it needs to, and prints the stack and variables at every stop:

$ box debug -b ContentView.swift:42 

The agent gets the stack and the variables as text and reads them itself, instead of guessing from print statements. You can print the variables you name, or every local. You can break on File.swift:42 or a function name, up to 10 of them. It's also exposed as an MCP tool, so the agent can call it without going through the shell.

Setup

You paste one line into Claude Code, Codex or Cursor:

Set up box with https://xenoci.com/setup 

The agent installs the CLI and gives you a link to sign in with GitHub.

Pricing: $0.05 per Mac minute (every started minute), prepaid in US dollars with $10 of credit to start, no subscription. Upload, queue and Mac start aren't billed, and a job that fails because of us costs nothing.

Site: https://xenoci.com

If you do iOS work with agents, I'm curious what you'd want the agent to get back from the Mac that it can't today.