Best practices for building iOS app via Jenkins?

My app is built by a Jenkins job, but I’m having some difficulty specifying which signing certificate and provisioning profile should be attached to the app. And I need to enable the “Push Notification” capability, but there doesn’t appear to be a way to do that from the command line; it only seems to be settable from within the XCode interface.

Is there a document that describes the best way to set iOS provisioning and capabilities via Jenkins? Any guidance would be appreciated.

Have a look to fastlane by twitter

fastlane is a tool for iOS, Mac, and Android developers to automate tedious tasks like generating screenshots, dealing with provisioning profiles, and releasing your application.

it does quite a few things concerning certs, signing, provisionning profiles and playing around with project settings. It’s a very handy set of command line tools written in ruby that will handle most of what you need.

Here’s a quick start:

I recommend you to try it on a simple blank ios app first.

  • Get certificates with cert
  • Sign your app/game with sigh
  • Build xcode project with gym

I was able to use this for my unity project, wasn’t easy, but it’s very useful.

There’s a great blogpost here about jenkins, fastlane and unity on medium

Haven’t tried it yet, but feel free to comment about your results. Always happy builds being automated :slight_smile:

Side note, ios xcode project is generated by unity so it needs to be generated first. You usually store fastlane folder at the same place as the built project, if you don’t, you need to pass a workspace parameter as I did. I placed my fastlane folder in the root of my unity project fastlane/fastfile and my xcode project is generated in builds/ios

Also note that the xcworkspace is generated from cocoapod.

Here’s my project’s fastlane/fastfile to quickly get you started:


The other way around would probably be to buy Unity Pro subscription and have your builds in the cloud, but I haven’t tried this yet.


Please share your story about jenkins and unity if you manage to get things working. I’d be happy to play with this too :slight_smile: