I'm new to Travis CI and have set up a basic build and test against a single project and environment. The .travis.yml looks like this:
language: objective-c
osx_image: xcode7
xcode_project: ./[project]/[project].xcodeproj
xcode_scheme: [project]
xcode_sdk: iphonesimulator9.0
That works great but I also want to test against. other iOS simulator versions (e.g. 8.4).
I realize I can use xctool from a script section like so in my .travis.yml and this works fine too:
script:
xctool -project ./[project]/[project].xcodeproj -scheme [project] -sdk iphonesimulator9.0 build test
Yet, I can't see how to run any other iOS version. The Objective-C docs for Travis CI say a host of simulator iOS versions is available for osx_image: xcode7, but when $ xcodebuild -version -sdk is run on the CI machine it only shows iOS 9 being available.
What am I missing here to be able to test other iOS versions against an XCode installation?
The trick to finding the available simulators is running:
and you will see the properties for the installed devices:
So then I built a matrix with env vars (reference) and defined the UDIDs for the simulator/OS version combos I wanted to test against. The script section is executed once for each unique environment variable/value defined. My .travis.yml file looks like this:
An example of this build can be seen here.