Integrate third party libraries in your IOS project and build with Jenkins

I have recently discovered that working with third party libraries and building your project outside your Xcode environment could be kind of tricky if you are not really an expert.
This document will show how to add the NewRelic framework to your ios project and build it on Jenkins.
The first thing you will need to do is to access/sign up on NewRelic from CloudBees (Services—>Add Services—>Select New Relic)

CloudBees ClickStartCloudBees ClickStart subscribed servicesNew Relic


Access NewRelic and create a new mobile application:


New Relic platformNew Relic mobile app


You will need to download the NewRelic sdk and add it to your IOS project.
Here there is a well-done tutorial on how to import NewRelic framework in your IoS project:
Once you have followed this guide and you have your project correctly configured locally, it’s time to put it somewhere so that your jenkin  job will be able to pull your code and build it.
You can use the SCM that you prefer, in this example we will use github.
If you do not have an account on github, create one, and commit your code there.  This is how the structure of my demo-project looks like on my github account:

github platform

Go on your jenkins instance on cloudbees: https:/
and create a new job configuring it so that it’s ready to build IOS project as explained in this step-by-step guide:
Of course you will need to change the git repo so that it points to your project.
Almost done!
Try now to build your project.

New Relic build projectNew Relic build


As you see, you will have an annoying error saying that the NewRelic framework can’t be found.
So, here we go: XCode compiler looks for the frameworks in a default path which won’t work on our slave since the workspace structure now looks different.

XCode compiler


The trick is to configure the Framework Search Path in Xcode to look recursively anywhere in the project workspace:
  1. open your project in XCode
  2. go to Build Settings
  3. look for “framework search Paths”
  4. add a new “./” recursive path

Xcode Framework Search Path


Build it locally to check it still works locally and commit your changes on github.
Go to your Jenkins Job and build it again:

Jenkins job build history view


Now it builds successfully !


Valentina Armenise
Software Developer