I have an SPM project that I need to test with xcodebuild
(because it has iOS resources such as XIBs). This project also supports Cocoapods so it also has .xcodeproj
and .xcworkspace
files.
Normally xcodebuild will automatically detect the Package.swift
file and use that to build, but now it detects the Cocoapods workspace and tries to go from that instead.
I read through the documentation for xcodebuild
, but couldn't find a flag to explicitly point it to the Package.swift.
Is there any equivalent to the --project
or --workspace
flag that I can use to tell xcodebuild to use the Package.swift
file and ignore the project and workspace?
swift package generate-xcodeproj --output ./tmp
to generate an Xcode project in a subdirectory first. Then I callxcodebuild build -project ./tmp/[project].xcodeproj
to build the SPM specific project. – Buckles