Settle newest iOS projects in Jenkins server – Part 2

Create & configure an IOS project in Jenkins

To create an iOS project in Jenkins, I recommend to get the project from a version control server, like git, gitlab, svn, etc. Here I use gitlab to clone my projects into Jenkins.


In the build action, Jenkins already provided an “Xcode plugin” for Xcode-use, but it’s out of date and would invite bugs later, so I use “running shells” instead. The configurations here are shown below:

  1. Add a clang-scan build action, and configure it like this:


  1. Add a running shell action, and copy the following codes and change the bold ones to your own project name/scheme

# generate clang reports
mkdir -p ${WORKSPACE}/../builds/${BUILD_NUMBER}/clangScanBuildReports/
cp ${WORKSPACE}/clangScanBuildReports/*/StaticAnalyzer/*/*/normal/i386/*.html ${WORKSPACE}/../builds/${BUILD_NUMBER}/clangScanBuildReports/

# generate junit test reports
xcodebuild -workspace Library.xcworkspace -scheme ‘Library‘ -configuration Debug -sdk iphonesimulator clean test 2>&1 | ocunit2junit
# generate the coverage report
/usr/local/bin/gcovr –root=”${WORKSPACE}” –exclude='(.*./Developer/SDKs/.*)|(.*test*\.m)’ -x > ./coverage.xml
# generate count report
sloccount –duplicates –wide –details ${WORKSPACE} > ./

If your are building a 64 bit project, please replace ‘i386’ with ‘x86_64’ to generate clang reports, which means using the following codes instead of the first part above:

# generate clang reports
mkdir -p ${WORKSPACE}/../builds/${BUILD_NUMBER}/clangScanBuildReports/
cp ${WORKSPACE}/clangScanBuildReports/*/StaticAnalyzer/*/*/normal/x86_64/*.html ${WORKSPACE}/../builds/${BUILD_NUMBER}/clangScanBuildReports/

After these scripts, add some post-build actions to release codes related reports, the configuration part would be like this:




The full configuration would be like this:







Ok it’s time to have a cup of coffee, we are almost there, just save it and run (and with finger-cross: P).

If everything goes well, you would see a big sun shows in the projects overview page. If you see a black cloud (which means a project failed) then please do remember to check the outputs from “console output”in project settings.


Combine Jenkins server together

For those who already have a Jenkins server running in Windows/Linux, you’ll have to set this new Jenkins as a “slave node” for your main Jenkins.


Pouclet, Romain,. Pro IOS Continuous Integration. 2014.

Setting up Jenkins with Git repository


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up
Follow Us