CICD For Mobile App Development

Indranil Majumder
3 min readJan 23, 2020

--

A super generic block diagram

This article is fit for teams developing cross platform apps, may be using a common language like React Native/Flutter and wants to integrate their automation tests with appium into the CICD flow.

This also assumes the interest in having a CICD on cloud with apple hardware.

General considerations

If there is an existing Jenkins setup running on a Linux or Windows(on-prem/cloud) reuse it to build feature/bugfix/develop branches for React native npm tasks, Android Gradle tasks etc.

If Jenkins is running on Linux or Windows platform, IOS builds are not feasible. Developer Mac’s local build can work as a supplement. This article will heavily depend on services like Bitrise for the end to end CICD setup.

Reuse existing Nexus to keep local builds for Android APK’s (plug the below stage to your existing Jenkins file and add the maven-publish plugin to your gradle build file) :-

Nexus supports NPM format archiving too -

nexus-npm

Note : You cannot run Android X86 or IOS emulators on AWS hosted CICD setup. You have to reply on aws-device-farm or sauce-labs

Bitrise gives you CICD as a service. It can run your CICD on managed apple hardware required for IOS builds.

It also allows you to run UI tests using Emulators.

Note : IOS and Android X86 emulators work on Bitrise.

For raw hosted apple hardware you can go to MacStadium.

You can connect your internal source code repo/nexus/backends to Bitrise via VPN. On start and completion of the build connect and disconnect the VPN correspondingly.

More info here — https://devcenter.bitrise.io/jp/tutorials/vpn-configuration/

For initial setup, just use a dummy GITHUB project to onboard an app into Bitrise. Once done add the VPN connection step in the workflow and change the app GIT URL/Name from the settings to point to your internal source code.

The reason for choosing Bitrise is it super easy setup and maintenance. Look at the below workflow setup. Just drag and drop!!

vpn step

Bitrise also allows to keep local build artifacts.

Release management

How your code reaches your CICD setup is very important on how effective your CICD can be. So let’s start with code release management.

  1. Make sure all feature/bugfix are merged to develop
  2. Create PR and merge changes from develop to master
  3. Create a release branch from master
  4. Create a tag from the release branch
  5. Increment build number in master and develop according to SemVer
  6. Beta push from tag build to play console/testflight.
  7. QA on beta build from play console/testflight
  8. Manual push to production (Play/App store)

Note: Auto incrementing android version code is a challenge. A public repo with only the version code number in a file can be kept which the bitrise workflow needs to clone, read and update whenever a upload to play console/store is required.

Fastlane

Fastlane is an amazing too with extremely low learning curve. All it asks for is that you have a Apple Mac.

Sample Fastlane setup

Using fastlane match & supply for release management should be part of a decent CICD setup

More details coming soon…

Device UI Tests using Appium

More details coming soon…

--

--

No responses yet