iOS Automation: Fastlane and Jenkins

iOS developers’ ultimate guide to manage time, signing process and builds.

Image for post
Image for post

First things first

Fastlane

Setup fastlane

Install fastlane on your machine

Navigate to the project and add fastlane

Add Cocoapods to the Gemfile:

How does Fastlane work?

How to manage Certificates?

How does match work?

Setup Match:

Create Certificates repo:

Install Match:

Add match to Fastfile:

Building the ipa:

Installing pods:

Updating build and version number:

gym:

Release:

Create the upload_testflight lane:

Upload dSYMs to crashlytics:

The final Fastfile:

Automate with Jenkins

What is Jenkins?

Define the automation process

Jenkinsfile

Stage 1: Setup

Stage 2: Build

Stage 3: Publish to TestFlight

I added the 3rd party stage as an example of checking the branch of it falls under any of the branches

Setup Jenkins

Install Jenkins on your machine

Automatically start Jenkins on mac start (Optional)

Start Jenkins Manually

Unlocking Jenkins

Image for post
Image for post

Selecting plugins

Creating the admin user

Instance Configuration

Image for post
Image for post

Project setup

Image for post
Image for post

Jenkins Project Configuration

Image for post
Image for post

Add Source

Image for post
Image for post

Add Credential

Image for post
Image for post

Branch Discovering

Image for post
Image for post
In this example, the branches are being checked as wild cards where “*” can be anything. You can filter by regular expression if needed.

Discover branches on git push

Install plugin to Jenkins

Image for post
Image for post

Add the webhook configuration

Image for post
Image for post

Configure Github webhook

Image for post
Image for post
Image for post
Image for post
This is how to make ngrok point to your Jenkins server. Copy the generated https url and use it as Jenkins_URL

Final Note:

iOS Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store