Run Kiwi tests from the command line with XCode 4.6
Just finished this article when Apple has released a major update, I’ve named XCode 5.0, so soon an updated article on how to achieve the same task under the new version of Xcode !
At first, I made some research on my favorite search engine, unfortunately none of the resources I found talked about running test suits for a project that was using CocoaPods.
The first article very interesting – but outdated – is Running OCUnit & Kiwi Tests on the Command Line by Stewart Gleadow. It helped me a lot to understand where to look, but since his article XCode has been updated and the private script that he was hacking has been changed… that is no longer a viable solution.
That’s why I thought about writing a new fresh article.
Configure your XCode schemes
First duplicate your main scheme. And let’s call this duplicated scheme
You need to activate the
Run checkbox for the
Here is a
Makefile that you can use. It takes care of various things :
- first thing to do is to shutdown the iPhone simulator, otherwise it can fail
ONLY_ACTIVE_ARCHtells Xcode to build for all architectures and not only for the one active
TEST_AFTER_BUILDno need to tell you about this one I guess
RUN_APPLICATION_TESTS_WITH_IOS_SIMpretty straight forward too
Real world example
I’ve integrate the whole thing into a project of mine, DPMeterView hosted on GitHub, and the project is integrated with Travis Continuition Integration servers. Learn more on how to integrate Travis-CI in your open source iOS project, to build stronger libraries!comments powered by Disqus