Tuesday, April 29, 2014

xctool, xcode, and Travis Integration

Hey Guys,

I know many people have been having trouble currently with xcode and xctool playing nicely with Travis and with the new 5.1 release of xcode there have definitely been some bumps in the road, but I have found a way that works for me. Here is a sample travis.yml file to see what it should be looking like and the pieces you will need to have it run properly:

travis.yml
language: objective-c
before_install:
  - gem install cocoapods
  - brew update
  - brew upgrade xctool
script:
  - xctool test -simulator ipad -freshInstall -workspace myApp.xcworkspace -scheme 'iPad Tests for Travis' -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
  - xctool test -simulator iphone -freshInstall -workspace myApp.xcworkspace -scheme 'iPhone Tests for Travis' -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO 

The most important addition to this yml file is adding brew update and brew upgrade xctool. This will upgrade your xctool to be compatible with the new xcode 5.1 build.

Secondly, you will need to take out any --freshSimulator hooks that you have in the script as the new build of xctool builds a fresh simulator each time and this can cause issues. Here is a link to the current issue on Github that members from Travis are currently addressing this if you need a reference point: http://bit.ly/1hNI8SE. Good Luck and let me know if you have any questions because I've definitely been through it with this the last few days!

No comments:

Post a Comment