Our project had already been using xcodebuild with '-scheme ', but fails now from the command line after we have added SPM dependencies. The build failures are all from trying to resolve GitHub repo dependencies for swift packages we're now using. Building from within the Xcode IDE works just fine opening the same 'project_name.xcworkspace' and building the same schemes. The first thing the IDE does when opening the workspace is resolve the SPM dependencies, before any attempt to do a debug or archive build. There is probably an xcodebuild option that does the same pre-flight SPM dependency check before trying to build the specified scheme. Unfortunately, I've not discovered what that magic incantation is yet.
A work-a-round we're using for now is our build scripts open the *.xcworkspace first to let the IDE gather together the SPM dependencies, then we can use xcodebuild to produce our archive and debug builds.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: