Skip to main content
Try it now: paste this line into Claude Code, Codex or Cursor. It installs box, signs you in with GitHub and runs your first build:
Your first sign-in adds $10 of credit, about 200 Mac minutes (once per GitHub account).
A common plan for iOS CI is “run on our own Mac, and use a GitHub-hosted macOS runner when the Mac is offline”. runs-on cannot express that by itself. A job whose labels match no online runner waits in the queue (up to 24 hours); GitHub does not move it to another label. So the choice has to be made before the job starts.

Pick the runner in a small job

A job on ubuntu-latest asks the API which runners are online and idle, then outputs a JSON label list. The macOS job reads it with fromJSON:
Notes:
  • Listing runners needs a token with the repository’s Administration: read permission. The default GITHUB_TOKEN cannot list runners, so use a fine-grained token stored as a secret.
  • Fork pull requests do not receive that secret, and the SAME_REPO check sends them to the hosted label anyway. On a public repository this keeps code from forks off your Mac.
  • busy can change between the check and the job start. Two pull requests may both pick your Mac; the second one then waits for the first. Add concurrency to the self-hosted path if you want that to be explicit.

Keep the Mac clean between jobs

A runner registered with ./config.sh --ephemeral takes one job and removes itself, so a small loop (for example a launchd job) has to register it again with a fresh registration token before each job. The same loop is a good place to delete build output and old simulators:

Or skip the fallback

If you would rather not keep a Mac online for CI, box runs the macOS jobs on a fresh Mac per job. Connect the repository and change the runner line:
See GitHub Actions setup. Related: macOS job was not acquired, GitHub Actions macOS runner alternative, CI on Macs. Start with $10 of credit, about 200 Mac minutes.