mountains-river-serene-view-image

An Easy Way to Make an iOS Build for TestFlight Using Jenkins

Introduction

Trends of software companies are moving to a total automotive structure, from project management to nightly builds to beta test distribution. Obviously well organized companies and startups are focusing on how can to serve nightly builds or Sprint based builds to the clients or beta users automatically.

The idea behind Continuous Integration has changed. Companies are now focusing on build management, release management, deployment, and distribution automation to improve their level of quality and efficiency.

A Continuous Integration Solution provides software developers and architects with a better sense of the development progress and code quality of projects throughout the development lifecycle.

Jenkins has been popular since early 2011 when it was released. Jenkins provides good support for Java with a one click build. Jenkins now also supports for various highlighted technologies by rising functionality rapidly. As an iOS and Android developer, nightly builds are also required for working on agile based projects. Nightly builds or Sprint based builds are required to client or Beta tester for analyze app stability and progress status. The Jenkins plugin provides facility to iOS app builds and sends builds to iTunes Testflight for beta testing for internal testers.

Have a few cups of tea or coffee ready, because it takes some time to complete reading this blog series. If you are ready to leverage benefits of Jenkins, let us begin by setting up Jenkins on your Mac laptop or computer.

Jenkins Integration

Jenkins is an open-source continuous integration software tool written in the Java programming language, so it is necessary to have JDK installed on your machine.

You can download the latest JDK for your relevant platform from.

You can Install Jenkins as a native package by download it from Jenkins Home Page, but we are going to install it using well known Software package Manager named “Homebrew”. Don’t worry about Homebrew, you can install Homebrew from terminal using given command.

To install Homebrew, simply copy-paste this code into your Terminal and press enter:

ruby -e “$(curl -fsSL

https://raw.githubusercontent.com/Homebrew/install
/master/install)”

After successful installation of Homebrew, you can use it to install Jenkins.

To install Jenkins, simply copy-paste this code into your Terminal and press enter:

brew install jenkins

If you want to run Jenkins on startup, you need to link the .plist files to Mac’s Launch Agents using given command.

ln -sfv /usr/local/opt/jenkins/*.plist ~/Library/LaunchAgents

Then you can start it up now or load to Jenkins with a given property list, run

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist

To stop or unload Jenkins, run

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist

You can also start Jenkins by running it as a command. This is what I prefer to do.

Now if you open localhost:8080 , you should be greeted by Jenkins –
“Welcome to Jenkins”:

Zymr Welcome to Jenkins

Congratulation you have successfully installed Jenkins for your Mac OS!

Lets have to start configure it with basic setup.

To Integrate Jenkins with iOS, the requirements for setup are:

    • Installation of XCode with all the elements.
    • Source repository account to pull source code(any Subversions).
    • Required verified Developer and Distribution profile in Keychain Access.
    • Keychain Access for logged in user to access provisioning Profile.

[See Also:Engineers Moving Smartly in iOS with RestKit]

Configure Global Security

Go to Manage Jenkins → Configure Global Security

To set security access and roles and responsibility to team members of project you have to set Global Security.

Here we setting basic security settings, you can set more advanced settings by assigning roles and responsibility to team members.

Check “Enable Security” box and configure basic settings as given in below Screenshot.

Zymr Configure Global Security

System Configuration

Here, we are set basic System Configuration as like JDK Installation, System Admin email address and E-mail
Notification.

JDK Installation

If JDK already installed on your system then uncheck “Install  automatically”, Apply value in JAVA_HOME and set name as a current installed JDK.

You can get value for ‘JAVA_HOME’ using execute command in terminal:
/usr/libexec/java_home

Zymr JDK

System Admin Email Address

Zymr Admin Email

E-mail Notification

Zymr Admin Email

Set advanced configuration for Email Notification from Advanced Tab.

Set username and password of email account of admin and set other options as given:

Zymr Advanced Settings

[See Also: iBeacon: New Era in Geofencing for iOS]

Manage Plugins

Install Jenkins Plugins as per needs and requirement to configure task to accomplish it automatically. Here, we requires two plugins to accomplish continuous build and deployment to iTunes Server.

To install plugins first open the “Manage Jenkins” page on the left-hand menu and go to “Manage Plugins” and go to “Available” tab to get available plugins list.

Manage Jenkins → Manage Plugins → Install Plugins → Available

Right now to perform our task we have to install below listed plugins.

Git Plugin

This plugin allows use of Git repo as a build SCM(Will explain in next part). To create continuous build from git repo we have to give access to particular project repo on git by configuring Git plugin.

To install Git Plugin, check “Git Plugin” and Install it by tapping install button at bottom of page.

Zymr Git Plugin

Now go to “System Configuration” to set basic configuration for git access.

Jenkins_6

Set Git User Name and Email as below :

Zymr Git Username

Xcode Plugin

This plugin adds the ability to call Xcode command line tools to automate build and packaging iOS applications.
To install Xcode Plugin, check “Xcode Integration” and Install it by tapping install button at bottom of page.

Zymr Xcode

Now go to “System Configuration” to set basic configuration for Xcode access and set keychain access to sign IPA as below:

Zymr System Integration

Now after a successful setup, it is time to use this configuration to create Job for project to build .ipa and upload it to Testflight of iTunes store. Check out Part II next on how to make a build as an .iPA file.

Everything you need to know about outsourcing technology development

Access a special Introduction Package with everything you want to know about outsourcing your technology development. How should you evaluate a partner? What components of your solution that are suitable to be handed off to a partner? These answers and more below.

Introduction Package

Source: zymr

This article was authored by Sitanshu Joshi, who is a Senior Software Engineer at Zymr.

0 comments

Leave a Reply

© 2019, Zymr, Inc. All Rights Reserved.| LEGAL DISCLAIMER | PRIVACY POLICY | COOKIE POLICY