SPM build fails for watchOS libraries

This is what I do:

Since CI builds are from the command line, I simply have that environment variable set. On the rare occasion something fails only on watchOS, I comment out the if while I’m working and re‐open Xcode.

It would be nice to have watchOS automatically evade tests in a similar way to how iOS evades executable targets. (Although even that seems to only work from the GUI and not command line invocations.) But as @NeoNacho said, those are the domain of Xcode, not SwiftPM.

4 Likes