An excellent article on how to set up continuous integration for your iOS projects with Jenkins, CocoaPods, and Kiwi. I found this after I’d already set up my project with Jenkins and Kiwi; it helped me fix a broken build after I added CocoaPods to the project. Specifically, running unit tests in our project now looks like this:
xcodebuild -workspace MyProject.xcworkspace -scheme "All Tests" -configuration Test -arch i386 -sdk iphonesimulator RUN_UNIT_TESTS=YES clean build
I found that we needed to add the workspace
and specify a scheme
. And, of course, we feed this into the excellent OCUnit2JUnit so we can see unit test reports in Jenkins. So here’s the final script (we’re also making sure the iOS simulator isn’t running):
killall -m -KILL "iPhone Simulator" || xcodebuild -workspace MyProject.xcworkspace -scheme "All Tests" -configuration Test -arch i386 -sdk iphonesimulator RUN_UNIT_TESTS=YES clean build 2>&1 | ocunit2junit
If you have any tips on what you’re doing with continuous integration, Jenkins, CocoaPods, or Kiwi, share them with me on Twitter.