Fix "xcodebuild: command not found" on Linux CI
# Fix "xcodebuild: command not found" on Linux CI
xcodebuild ships with Xcode, and Xcode only runs on a Mac. On a Linux machine the shell says so directly:
bash: xcodebuild: command not found
Nothing installs Xcode on Linux. The build has to run on a Mac. box does that and returns the log.
Run it
box build
The same project that fails on Linux builds on the Mac, job bj_QBEvaDCprIfgfmKE:
** BUILD SUCCEEDED ** [box] BOX_BUILD_SECONDS=6 rc=0 box: bj_QBEvaDCprIfgfmKE succeeded, 60s billed, $0.05
To see the Xcode version the Mac is using, run box exec -- xcodebuild -version. A real run, job bj_r2K_CdYLlqz3PWGZ:
Xcode 27.2 Build version 27B52 box: bj_r2K_CdYLlqz3PWGZ succeeded, 60s billed, $0.05
What it costs
$0.05 per minute of build and test time on iOS, every started minute. A job that fails because of box costs nothing.
How else people do this
GitHub-hosted macOS runners include Xcode and 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.