The problem is that these targets do not compile on Simulator. I'd like to just exclude them entirely and I can use #if available or #if !targetEnvironment(simulator) to avoid importing them.
That would work out of the box, but it still tries to link. How do I disable linking for simulator only?
I can't use conditions because the platforms don't include simulator. Which is pretty frustrating. If simulators cannot do the same thing that iOS can do, then it should be a condition
I'm not sure if this does a great job at directly answering your question… but one strategy I see to work around limitations in SPM is passing environment variables from shell and then building the package manifest from conditional logic on those variables. It's not as elegant as a "proper" API… but this might be a legit strategy for now given the current abilities of SPM… but YMMV and there could be new APIs on SPM I do not know about that do this in a better way.
Build scheme meaning Xcode Build Scheme? I have not tried. I believe this pattern was mostly for running builds from command line and CI servers. I think it might work from Xcode… want to give it a try and see what happens?