Xcodebuild does not support test targets and application tests. I would try xctool , which is a good alternative to Xcodebuild and makes testing iOS and OSX applications easier. Travis CI comes with a preinstalled version.
To install it locally on your computer, you can use homebrew.
update brew brew install xctool
You can use the following command to create the 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 .travis.yml
language: objective-c script: - xctool -workspace MyExampleProject.xcworkspace -scheme MyExampleProject -sdk iphonesimulator - xctool test -workspace MyExampleProject.xcworkspace -scheme MyExampleProjectTests -sdk iphonesimulator
source share