Automating iOS Certificate and Profile Syncing with Fastlane

Before Fastlane

There are two iOS developer programs, the Apple Developer Program and the Apple Enterprise Developer Program. The Apple Developer program allows you to build and distribute public apps for the iPhone, Apple Watch, and other Apple platforms through the App Store. The Apple Enterprise Developer Program is for distributing apps within an organization.

  • Upload the CSR to the Apple iOS Dev Center in order to create a Certificate
  • Download and store the certificate
  • Install the certificates on any machines that will be building the app
  • Certificates
  • Devices associated with this profile

Life in the Fastlane

Fastlane is a command line tool and according to their website “It’s the easiest way to automate building and releasing your iOS and Android apps”. Fastlane is a suite of tools that automates the synchronization of certificates and profiles for all developers on the project.

  • Manual update and synchronization of provisioning profiles through Xcode
  • Encrypts and stores certificates and keys in a private git repository
  • Shares the keys with other developers and build systems from the git repository

Using match in your project

To set up match, create a private git repository. This can be any git repository either on the cloud or elsewhere, we recommend creating a new git repository to gain more control over access rights but you could also use an existing branch in your project’s git repository.

sudo gem install fastlane
sudo fastlane match init
sudo fastlane match development sudo fastlane match adhoc sudo fastlane match appstore
sudo Fastlane match <development|adhoc|appstore> -- readonly
sudo fastlane run register_devices devices_file:"/path/to/devices.txt"
sudo fastlane match <development|adhoc|appstore> --force_for_new_devices
sudo fastlane match <development|adhoc|appstore> --readonly

Summary

Fastlane simplifies the setup of your project by sharing one code signing identity across your team. Onboarding new developers can be automated with Fastlane’s command line tools without any of the manual processes such as signing up for an Apple Developer Account.

A full-service software development & UX design firm helping leaders in healthcare craft innovative digital & connected health solutions. macadamian.com