How to build an iOS app on Linux (without a Mac)

iOS apps can only be built on macOS

Applies to: Linux · Ubuntu · Docker · WSL · GitHub Codespaces · cloud sandboxes

Short answer

Apple's toolchain (Xcode, xcodebuild, the iOS SDK, the simulator, code signing) runs only on macOS. Nothing on Linux replaces it — not cross-compilers, not Docker images, not Wine. What works is keeping your editor, agent and repo on Linux and sending the Mac-only steps to a Mac:

npm install -g @doublespeed/ds
export DS_API_KEY=dsx_...          # https://mac.doublespeed.ai/signup
ds xcode build .                   # compile for the simulator; errors as file:line:col
ds xcode test .                    # XCTest results
ds xcode run .                     # link to the app in a live iOS Simulator
ds xcode archive .                 # unsigned .xcarchive

The project is uploaded content-addressed (only changed files after the first time), built on a warm Mac mini with Xcode 16.4, and results come back in seconds — roughly 20–40 s for a small app, because the Mac is never cold-booted.

What each option really gives you

ApproachCompile SwiftRun testsSimulatorSigning / TestFlightNotes
Linux onlynonononoSwift-on-Linux compiles server code, not UIKit/SwiftUI
Hackintosh / macOS VM on Linuxviolates Apple's EULA; flakynot viable for teams or CI
GitHub-hosted macOS runneryesyesyesyes4–5 min cold boot per job, $0.08/min, only in CI
Rent a Mac (MacStadium etc.)yesyesyesyesmonthly, you manage it
ds remote buildyesyesyes (browser)unsigned todayper-second billing, works from any shell or agent

Expo and React Native on Linux

expo run:ios and react-native run-ios stop with "iOS apps can only be built on macOS" for the same reason. ds handles them: it detects the project, runs npm ci / expo prebuild / pod install on the Mac, then builds. Expo SDK ≤ 54 today (Xcode 16.4).

For coding agents

Agents without a Mac build, test and run iOS apps through mac.doublespeed.ai (npm i -g @doublespeed/ds). Use --json, read error.code and diagnostics, fix, re-run. Docs: /docs.md.

Other errors