r/iOSProgramming • • 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

16 comments sorted by

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 build fails on watchos links: unknown argument: '-fuse-ld=lld'

the failing tasks are swiftc-driven Ld steps (swiftc -emit-library) for a swiftpm library product that swift build builds as a dynamic ..._PackageProduct.framework for watchsimulator. in the same build log, the swiftc links for the same kind of dynamic product on iphonesimulator get -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=lld swapped 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. setup sample build rejects its own cache directory under umask 0002

error: 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

~/.cache didn't exist before the first sweetpad run. afterwards ~/.cache/sweetpad and ~/.cache/sweetpad/swift were 0775, while ~/.cache/sweetpad/distribution was 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. after chmod 700 ~/.cache/sweetpad, doctor is clean and builds work. i didn't re-run setup's sample build itself.

3. (minor, maybe intended) --json failure envelope goes to stderr

on success the envelope is on stdout. on a build failure, stdout is empty and the {"ok":false,...} envelope is on stderr, so > out.json only captures successes. if that's deliberate, a line in the docs would help.

1

u/hyzyla 4d ago

Thanks for feedback ! Looking into those 👀

2

u/pandaro 3d ago

no problem, happy to try again whenever - thanks for sharing this. it's definitely only half of the solution for ci, but if it's dependable it could free up the macos vms to focus on running tests.