box

Guides

Run XCTest without a Mac

# Run XCTest without a Mac

XCTest runs inside the iOS simulator, and the simulator only runs on a Mac. From Linux the test command fails before a single test starts. box runs the tests on a simulator on a real Mac.

Run it

box test

A real run, job bj_FsKyhQhqbroz8BoM:

Test Case '-[BoxDemoTests.CountTests testStartsAtZero]' passed (0.004 seconds).
Test Suite 'All tests' passed at 2026-11-28 03:05:14.925.
** TEST EXECUTE SUCCEEDED **
box: tests 1 passed, 0 failed
box: bj_FsKyhQhqbroz8BoM succeeded, 120s billed, $0.10

The result bundle is saved at .box/out/bj_FsKyhQhqbroz8BoM/test.xcresult.zip.

What it costs

$0.05 per minute of build and test time on iOS, every started minute. The run above was two minutes, which includes booting the simulator.

How else people do this

Xcode Cloud runs tests on Apple's Macs and is billed in compute hours (https://developer.apple.com/xcode-cloud/). GitHub-hosted macOS runners cost 10 times the Linux per-minute rate (https://docs.github.com/en/billing/reference/actions-runner-pricing).

Apple, Mac, macOS, iPhone, Xcode, Swift and SwiftUI are trademarks of Apple Inc., registered in the U.S. and other countries and regions. box is an independent service and is not affiliated with, sponsored or endorsed by Apple Inc.