Run iOS code analysis on CI

I want to to check if the swift code of our iOS app is correct, type-checked, on CI. I tried xcodebuild analyze but I have to run it on macos servers, where they have a long queue since they are building other jobs. But the Linux container's queue is empty most of the time, so desirably I want to run the swift command to only running the frontend of the compiler on the iOS code on Linux. Is this possible? What configuration I need? Spoiler the code doesn't have Package.swift file!

Thank you for your time!

This is only really possible if you've split your codebase into packages and some of those packages can build without any Apple frameworks. Theoretically possible, but very hard in practice, especially since Foundation isn't complete cross platform.

Alternatively, you could try using xtool, which may be able to get enough of the SDK definitions for you to at least partially build Apple SDK code on Linux.

1 Like