Skip to content
A script that converts output from OCUnit in xcodebuild to the XML format used by JUnit. This allows for XCode builds on continuos integration servers like Jenkins, complete with test reports!
Ruby Roff Objective-C
Branch: master
Clone or download
Latest commit 8ec2cd9 Sep 21, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Merge pull request #40 from mikelupo/handleXCUnitRestart Apr 24, 2017
test Fix tests. Aug 10, 2018
.gitignore Add basic tests in anticipation of Ruby 1.9 fix Aug 5, 2012
.travis.yml Adds support for Travis CI. May 16, 2013
example.png Updated script to support Kiwi output and updated Readme Feb 12, 2012
ocunit2junit.gemspec Bumps gem version to 1.4 Sep 29, 2014

Build Status


OCUnit2JUnit is a script that converts output from OCUnit or Kiwi to the format used by JUnit. The main purpose is to be able to parse output from Objective-C (OCUnit) test cases on a Java-based build server, such as Jenkins.


  • Install with 'gem install ocunit2junit' (possibly prepended by 'sudo' if your Ruby installation requires that)


  • Make sure your build server can access the xcodebuild executable

  • Use this shell command to build:

    xcodebuild -target <target> -sdk <sdk> -configuration <config> 2>&1 | ocunit2junit

  • The output is, by default, in the test-reports folder

  • If your build fails, this script will pass the error code

  • All output is also passed along, so you will still see everything in your build log


This script also generates human readable test results for Kiwi BDD Testing Framework:

Example output

However, if you don't want this, you can disable it in the header:


More information

  • If you're having issues with character encoding, please upgrade to Ruby 1.9.2 or later.
  • More info can be found in this blog post.


Free to use however you want.


OCUnit2JUnit was created by Christian Hedin. Twitter: @ciryon Google Plus:

You can’t perform that action at this time.