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.
How should you start unit testing your app?
Unit testing for iOS can be lonely — most iOS developers don't seem to be doing it. Should you be writing unit tests? What are the benefits of unit testing, anyway? And if it is worth the effort, how do you get started? Enter your name and email in the boxes to get answers to your questions.