Oursky Code
  • AI
  • Auth
  • More from Oursky
    • Oursky Business Blog
    • GitHub
    • About Us
  • AI
  • Auth
  • More from Oursky
0
Subscribe
Oursky Code
Oursky Code
  • AI
  • Auth
  • More from Oursky
    • Oursky Business Blog
    • GitHub
    • About Us
  • iOS
  • Opensource

Continuously Delivering iOS Beta Builds Automated with Travis CI

  • March 26, 2015
  • No comments
  • 4 minute read
  • David Ng
Total
0
Shares
0
0
0

Over the years, we’ve been building loads of nicely-crafted iOS applications for our clients.

To keep everyone work closely, we send daily builds to our QA Team, beta users, clients, other team members. However, building an iOS is still painful for Project Manager — It involves compiling, uploading the app to TestFlight or HockeyApp,
setting up  Crittercism for collecting crash reports (Those who have experience, should know that you have to upload dSym files for symbolic debug messages), notify everyone on Slack, etc.

Much better if we can automate all these with each Pull Request.

Overview

Our engineers came up with a Reusable iOS script for Travis CI to ease our pain. Check out the script at https://github.com/oursky/travis-ios-script

Idea overview illustration

CI (Continuous Integration) is delightful

CI has delighted us (and other worldwide developers) by being able to :

  • Automate the unit-testing process
  • Standard build settings
  • Maintain a code repository
  • Build fast
  • Support multiple build targets

Delivering builds have never been this easy

 

However, whenever initiating a project, our engineers have to spare some time (and that’s not short) setting up configurations for CI, including dealing with iOS Provisioning profiles, build settings, dependencies, etc.

Upon spending time setting up a few iOS Apps,

“Are we repeating ourselves?” yelled the voice from inside.

We’ve also noticed that the bottleneck for delivering a build is at the “Developer → QA” process

In legacy time, upon a beta build delivery, the PM has to :

  1. Ask the developer to push code to beta branch
  2. Pull code from the beta branch
  3. Fix cert and dependencies
  4. Build the app
  5. Upload to Testflight / Hockey App
  6. Update dSym file at Crittercism
  7. Notify QA Tester / Client the build is available

By building on Travis CI, we partially saved the PM’s life by automating the building and environment configuring process.
The well-built (and tested) project build is now ready for delivery.

Why don’t we further automate the delivery stage?

Beyond Auto-building – Automating the delivery process

Our engineers prepared a reusable script that basically helps initiate the Travis CI settings for every iOS project.

With proper settings and valid API keys, the deliverable built on Travis CI will then be delivered to other App distribution platforms.

Developers only have to put required the certificates, provisioning profiles and API Keys in the corresponding directories.
Then fill in the blanks for project settings in travis.yml.

The repository also includes scripts that enable signing and uploading. Project code will be compiled upon pushing to branches, then uploaded to Testflight / HockeyApp, and the dSym files will go to Crittercism as well.

Now, the latest build will be built and delivered automatically, available for beta testing in a minute.

“Push and deliver” feels like… (Sorry for Frozen)

Oh, we even have the build result pushed to Slack. So other team members in channel could keep track on the progress.

Get notified with Slack

Life gets better

Required Set-up time for Travis CI : 1 day (Before) → 30mins (After)

Steps to deliver a build : Push, pull, fix dependencies, build, upload to various places, delivered (Before) → Push, delivered (After)

Bonus: Sometimes a project could be built on Bob’s machine but not in Ada’s.
Integrating the CI process also standardizes build settings among developers (CI setting as the standard).

Yeah! That sounds really great now.

Let’s get some coffee.

How to use the script?

Checkout the repository of the Reusable iOS script at https://github.com/oursky/travis-ios-script .
You may also find guidelines setting up for your project in the project README.

Setting up the certs and provisioning profiles

  • Place all encrypted cert and private key in cert directory
openssl aes-256-cbc -k “<ENCRYPTION_SECRET>” -in dist.cer -out ./certs/dist.cer.enc -a
openssl aes-256-cbc -k “<ENCRYPTION_SECRET>” -in dist.p12 -out ./certs/dist.p12.enc -a
  • Place all encrypted provision profile in profile directory
openssl aes-256-cbc -k “<ENCRYPTION_SECRET>” -in <PROFILE_NAME>.mobileprovision -out ./profile/<PROFILE_NAME>.mobileprovision.enc -a
  • Add encryption secret key:
travis encrypt “ENCRYPTION_SECRET=<Encryption Secret Key>” — add
  • Add protection password for private key:
travis encrypt “KEY_PASSWORD=<Protection Password>” — add

Upload to TestFlight, HockeyApp and Crittercism

  • Enable uploading testflight branch to iTunes Connect by iTunes Connect account:
travis encrypt “DELIVER_PASSWORD=<Password>” — add
  • Enable uploading hockeyapp branch to HockeyApp by adding App ID and App Token:
travis encrypt “HOCKEY_APP_ID=<App ID>” — addtravis encrypt “HOCKEY_APP_TOKEN=<App Token>” — add
  • Enable uploading dSYM file to Crittercism by adding App ID and API Key:
travis encrypt “CRITTERCISM_APP_ID=<App ID>” — addtravis encrypt “CRITTERCISM_KEY=<API Key>” — add

If you favor Travis CI for iOS project + more:

Check out the Reusable iOS script at https://github.com/oursky/travis-ios-script

We wish to see more automated integration that delights our lives.
Pull requests are welcome.

oursky/travis-ios-script

Read more from Oursky

Total
0
Shares
Share 0
Tweet 0
Pin it 0
Related Topics
  • app
  • beta
  • CI
  • iOS
  • Travis
David Ng

Next Article
  • Android

Hands on Realm Database for Android projects

  • May 6, 2015
  • Jim Chim
View Post
You May Also Like
View Post
  • DevSecOps
  • Opensource
  • Security and Privacy

Kubernetes Security – Network Encryption between k8s Deployments and Ingress

  • September 4, 2020
  • Elliot Wong
oursky opensource github
View Post
  • Android
  • Opensource

An Opensourced Recipe for Intializing Redux x Android Native Apps

  • May 9, 2018
  • David Ng
discourse forum deployed on kubernetes k8s
View Post
  • Opensource

How to set up an internal team forum in half a day using Discourse

  • January 29, 2018
  • Ben Cheng
iphone X ios 11
View Post
  • iOS

Preparations you may have missed before submitting an iOS 11 app

  • October 9, 2017
  • David Ng
View Post
  • Opensource

A spreadsheet-based API for building MVPs.

  • July 20, 2017
  • David Ng
View Post
  • DevOps
  • Opensource

How I built a Kubernetes cluster so my coworkers could deploy apps faster

  • May 26, 2017
  • cheungpat
View Post
  • Android
  • iOS
  • UX/UI Design

Offline-First: No More Network Connection Error

  • August 12, 2016
  • May Yeung
View Post
  • Android
  • iOS
  • Software Testing

Journey Through Agile Test Automation

  • May 6, 2016
  • Joyz Ng

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Subscribe Us

Join our mailing list to never miss an update!

Oursky Code Blog
A team of Developers, Designers and Geeks. All about hacking and building things.

Input your search keywords and press Enter.