xcode7 - Targeting multiple iOS versions in your .travis.yml -


i'm new travis ci , have set basic build , test against single project , environment. .travis.yml looks this:

language: objective-c osx_image: xcode7 xcode_project: ./[project]/[project].xcodeproj xcode_scheme: [project] xcode_sdk: iphonesimulator9.0 

that works great want test against. other ios simulator versions (e.g. 8.4).

i realize can use xctool script section in .travis.yml , works fine too:

script:         xctool -project ./[project]/[project].xcodeproj -scheme [project] -sdk iphonesimulator9.0 build test 

yet, can't see how run other ios version. objective-c docs travis ci host of simulator ios versions available osx_image: xcode7, when $ xcodebuild -version -sdk run on ci machine shows ios 9 being available.

what missing here able test other ios versions against xcode installation?

the trick finding available simulators running:

$ xcrun instruments -s devices 

and see properties installed devices:

known devices: travis’s mac (129) [00000000-0000-1000-8000-005056a6dcd8] ipad 2 (8.1) [22540c0c-46b4-4ff8-9b74-6321081ca975] ipad 2 (8.2) [03655e8b-725b-4c03-a505-8eea0be5a966] ipad 2 (8.3) [bbc2737b-be8d-403b-804f-5a36560ad47b]  etc... 

so built matrix env vars (reference) , defined udids simulator/os version combos wanted test against. script section executed once each unique environment variable/value defined. .travis.yml file looks this:

language: objective-c osx_image: xcode7  ## create build matrix execute against multiple simulators/ios versions ## udid used below determin destination test against ## script section run once each definition ## iso_device not used in script useful know os version tested , show in travis make easer read env:   - udid="fcbb11b4-d7c8-4085-9067-2ceda2bfc895", ios_device="iphone 6 plus (9.0)"   # - udid="363ade93-270b-4c2e-9286-c3c1fabe3cdd", ios_device="iphone 4s (8.1)"   - udid="be52c183-b4af-408d-ae90-278fa4ad89ec", ios_device="iphone 5 (8.3)"   - udid="fcbb11b4-d7c8-4085-9067-2ceda2bfc895", ios_device="iphone 6 plus (9.0)"   - udid="beea639c-46eb-48ef-8377-a22b781a7ee2", ios_device="ipad air 2 (8.4)"  ### setting simulator auto-test , running build via xcodebuild tool: script:   # xcrun devices here print out list of available devices can snag udids   - xcrun instruments -s devices   - echo staring build , test...   - open -a "simulator" --args -currentdeviceudid $udid   - xcodebuild test -project ./movinghelper/movinghelper.xcodeproj -scheme movinghelper -configuration debug -sdk iphonesimulator -destination "platform=ios simulator,id=$udid"   - osascript -e 'tell app "simulator" quit' 

an example of build can seen here.


Comments