Xcode 6.4 Swift Unit Test Won't Compile: "GPUImage.h not found" "failed to import bridging header"
Xcodebuild
doesn't properly support test targets and application tests. I'd try xctool, which is a nice alternative to xcodebuild
and makes it easier to test iOS and OSX apps. Travis CI comes with it pre-installed.
To install it locally on your machine, you can use homebrew.
update brewbrew install xctool
You can use the following command to build your code. Its structure is identical to xcodebuild
.
xctool test -workspace MyExampleProject.xcworkspace -scheme MyExampleTests -sdk iphonesimulator
To run it on Travis CI, add the following code to your .travis.yml
language: objective-cscript: - xctool -workspace MyExampleProject.xcworkspace -scheme MyExampleProject -sdk iphonesimulator - xctool test -workspace MyExampleProject.xcworkspace -scheme MyExampleProjectTests -sdk iphonesimulator