r/iOSProgramming • u/hyzyla • 3d 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
2
u/ThalesMother9938 1d ago
Zero chagnes to the Xcode project is the part that got my attention, because that's usually where these setups fall apart. How do you handle code signing and provisioning profiles on Linux, or is that the one step that still needs a Mac?
2
u/mrdzyn 1d ago
This is a really interesting idea. Curious how you're handling the parts that usually depend on Apple's own tooling, like compiling asset catalogs and storyboards, and code signing? I could see this being super handy for CI runners where macOS minutes get expensive, even if the final signing and upload still happens on a Mac.
1
u/hyzyla 21h ago
Most of those tools I reimplmented them from scratch to make them work on linux. here is a list of those tools:
Storyboards and XIBs β
ibtoolAsset catalogs β
actoolCore Data models β
momcCore Data migration mappings β
mapcString Catalogs β
xcstringstoolApp Intents metadata β
appintentsmetadataprocessorCode signing β
codesignEntitlement encoding β
derqSome are hard to port, so they stay on mac. I'm thinking maybe to have remote server or something that will allow remotly call those
Metal shaders β
metal,metal-ar,metallibCore ML models β
coremlcSceneKit assets and shaders β
scntool,copySceneKitAssets,compileSceneKitShadersRealityKit assets β
realitytoolAR reference objects β
referenceobjectcSpriteKit texture atlases β
TextureAtlas
5
u/Zenmodo 2d ago
FYI linking against the SDKs in any way on a non-Apple platform is against their developer program terms and if caught doing this can result in your developer license being suspended.
> You agree not to install, use or run the Apple SDKs on any non-Apple-branded computer
Other versions of this idea have been done in the past but donβt gain much traction for this reason.
2
u/ct_the_man_doll 2d ago
I wonder if we might see someone work on a open source SDK for Apple devices.
1
u/zellJun1or Foundation 3d ago
Isnβt it using the open source foundation for Linux which is not complete?
2
2
u/pandaro 2d 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.