Skip to main content

Build iPhone apps on Linux

SweetPad can compile an Xcode project on Linux and produce an iPhone app. An unsigned build needs three things on the Linux host: the SweetPad CLI, a Linux Swift compiler, and Apple SDKs from your copy of Xcode.

Experimental

The validated environment is a Linux VM on Apple hardware. Setup supports Ubuntu 24.04 and Debian 12 or 13 on ARM64 and x86_64. It also supports Arch Linux on x86_64. See supported hosts.

Start here​

  1. Install the CLI for your Linux host architecture.
  2. Set up the Apple toolchain. Use an Xcode download on Linux or an SDK export from an existing Mac installation of Xcode. Setup imports the SDK and checks it by building an unsigned sample app.
  3. From your own project, build for a generic iPhone. Replace the project and scheme names in this example.
sweetpad build --project MyApp.xcodeproj --scheme MyApp \
--destination 'generic/platform=iOS' --json --non-interactive \
-- CODE_SIGNING_ALLOWED=NO

The destination selects the iPhone SDK and CPU architecture. You can compile without a connected phone or signing identity. The JSON field data.productPath gives the path to the app.

Choose your next step​

GoalWhat you need
Run on an iPhoneConfigure development signing, then pair the phone, install, and launch.
Run iOS testsLinux can build test products. A Mac with Xcode runs them on a simulator or phone.
Distribute an appArchive and export with the identity and profiles for your distribution method.
Build an iPhone app in GitHub ActionsUse the Ubuntu workflow.
Build a macOS app on LinuxCompile and export for a macOS destination.
Build a React Native workspacePrepare JavaScript dependencies, generated code, and Pods before compiling.

The iOS Simulator, Apple test execution, and running macOS apps require a Mac. SweetPad does not support debugging an iPhone from Linux. See how Linux builds work and the support reference for project and resource limits.