Auto Build and deploy IOS application using Jenkins

Here’s a step-by-step guide to build and deploy IOS application using Jenkins:

1. Create Your Accounts

2. Create your BitBucket repo

3. Download and Install Jenkins

  1.  Download  and Install Jenkins.
  2. Go to application -> Jenkins Folder -> Double click on Jenkins.war file ->Go to Safari Browser  -> type http://localhost:8080 ->press enter Jenkins server will start .

4. Install Jenkins Plugins

Under  ‘Manage Jenkins’  ->  ‘Manage Plugins’ -> ‘Available Section’,  select and install

  1. Xcode Plugin
  2. TestFlight Plugin
  3. Github and Git Plugins .
  4. Email-ext plugin and Click on “Download now and install after restart “.

 5. Setting up a secured Jenkins instance

  • To setup up a secured instance, click on “Manage Jenkins” and then “Configure System”.
    1. Under “Access Control > Security Realm”, select the “Jenkins’s own user database” option and check the “Allow user to sign up” checkbox below it.
    2. Under “Access Control > Authorisation”, select the “Logged-in user can do anything”.
  • Once you save it, click on the “Sign In” link to create a Jenkins user account.
  •  (Optional) Once you have created a user and logged in, you’d want to lock down your Jenkins instance and prevent new sign-ins. To do so, go to the “Configure System” page, uncheck the “Allow user to sign up” checkbox below it under “Access Control > Security Realm” section.

6. Configure System configuration

     Go to manage Jenkins  -> select System Configuration.

  • Jenkins Location section :

    Change “Jenkins URL” ->[http://ip address:8080] (e.g : http://192.xxx.x.xxx:8080/ ).
    Change “System Admin e-mail address” ->provide your email id.

    Screen Shot 2013-09-06 at 5.41.32 PM

  • Email Notification  section : Provide all fields value according to you email server configuration.Screen Shot 2013-09-06 at 5.40.42 PM
  • Test Flight section :
    Go to your test flight account  Team info page. Team name as ‘Token Pair Name’ and team token and select the “Upload Api” you get the api_token value.Screen Shot 2013-09-06 at 5.38.25 PM
  • GitHub Web Hook section :Check the radio button ‘Let Jenkins auto-manage hook URLs’.Screen Shot 2013-09-06 at 5.38.25 PM

7. Setting up your first Jenkins iOS job

  1. Create a new Jenkins job. Lets call it “first-ios-app” (make sure the name you choose doesn’t have spaces) and select “Build a free-style software project” as your job type.Screen Shot 2013-09-10 at 3.02.57 PM
  2. Setup your “Source Code Management”
    1. Set URL of Repository to be “https://novasys@bitbucket.org/jenkins-ios-example.git”
    2. Branch to build should be “*/master”.Screen Shot 2013-09-10 at 3.04.45 PM  
  3. Click on “Add build step”. If you have the Xcode Hudson plugin installed successfully you should be able to select “Xcode” (If not then the plugin was not installed correctly).
    1. Target “JenkinsIOSExample”
    2. Configuration “Debug
    3. Check “Updated version with build number”“Clean before build” and “Build IPA”.xcode
  4. Under “Post-Build Actions”
    1. Select “E-mail Notification” and provide your_email_id.
    2. Select “Editable Email Notification” and provide all ‘Project Recipient List’ click on ‘Advanced‘ button you trigger email for build status(success,failure,fixed,unstable etc.).Screen Shot 2013-09-10 at 3.10.49 PM
    3. Select “Upload to Testflight” and select ‘token pair’ also provide ‘Build Notes’.testflight
  5. Under “Build Triggers”
  • Check the checkbox of  “Trigger builds remotely” and provide “Authentication Token” value (this token is used to authenticate your job to repository).rmotetoken
  • Go to your bitbucket account and go to specific repository setting option and click on “Hooks” option and select Jenkins.Screen Shot 2013-09-10 at 3.36.31 PM
  • Click on add hook button,Provide End Point([jenkins url]/jenkins/job/[job name]/build?token=[Authentication Token]) ,Token(Optional),Project name(Job name),Module Name(Optional).

Screen Shot 2013-09-10 at 3.38.18 PM

  • Check the checkbox of “Poll SCM” and Schedule the build trigger.

Screen Shot 2013-09-10 at 3.15.03 PM

The following two tabs change content below.

Naveen Kumar Dungarwal

Latest posts by Naveen Kumar Dungarwal (see all)

Submit a Comment

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current month ye@r day *