r/iOSProgramming • u/hyzyla • 5d ago
3rd Party Service Build Xcode projects on Linux with SweetPad
https://sweetpad.hyzyla.dev/blog/2026/11/21/build-xcode-projects-on-linux/Hello! I would like to share my CLI that allow to build native iOS applications on Linux. It works with Xcode projects with zero changes and make possible to build native ios applications without macOS at all
17
Upvotes
View all comments
2
u/pandaro 4d ago
sweet serendipity! i started working on same yesterday.
tried on a real app: ~215k lines of swift in about 630 files, plus at least one vendored c library (libopus). it's 7 xcode targets: a swiftui ios app, share and notification extensions, an embedded watchos app, and test targets. it also uses local swiftpm packages and has git swiftpm dependencies. fresh deb 13 vm, 8 vcpu, sweetpad 0.1.28 from the apt repo, sdk imported from the xcode 27.2 .xip.
the device and simulator builds just worked (unsigned): 142 s cold for
generic/platform=iOS, 18 s incremental, and the simulator build succeeded too. very impressive. three things i hit:1.
test buildfails on watchos links:unknown argument: '-fuse-ld=lld'the failing tasks are swiftc-driven
Ldsteps (swiftc -emit-library) for a swiftpm library product that swift build builds as a dynamic..._PackageProduct.frameworkforwatchsimulator. in the same build log, the swiftc links for the same kind of dynamic product oniphonesimulatorget-use-ld=lld -ld-path=.../ld64.lld, while the watchsimulator ones get-fuse-ld=lld -ld-path=.... swiftc has no-fuse-ld. i re-ran the failing command by hand with-use-ld=lldswapped in, and it links fine and produces a mach-o. so it looks like the watchos path picks the clang spelling of the flag for a swiftc-driven link. the scheme has watch unit and ui test targets. i haven't built a minimal repro.2.
setupsample build rejects its own cache directory under umask 0002error: Setup sample build failed: cannot prepare build utilities: build utility cache must be owned by the current user and writable only by that user: ~/.cache/sweetpad~/.cachedidn't exist before the firstsweetpadrun. afterwards~/.cache/sweetpadand~/.cache/sweetpad/swiftwere 0775, while~/.cache/sweetpad/distributionwas 0700. that's consistent with the mode only being applied to the leaf of a recursive mkdir. this was a regular (non-root) user on a stock debian 13 cloud image, where the login umask is 0002 (user private groups). root and most containers get 0022, so they won't see it. afterchmod 700 ~/.cache/sweetpad,doctoris clean and builds work. i didn't re-run setup's sample build itself.3. (minor, maybe intended)
--jsonfailure envelope goes to stderron success the envelope is on stdout. on a build failure, stdout is empty and the
{"ok":false,...}envelope is on stderr, so> out.jsononly captures successes. if that's deliberate, a line in the docs would help.