Skip to main content

Mobile CI/CD

Mobile apps are complex, requiring a highly-tuned user experience and deep integration into native APIs and third party SDKs. To ensure consistent quality and help development teams move quickly, investing in a CI/CD pipeline is a must.

A proper CI/CD pipeline for enterprise apps on the Ionic stack will involve a pipeline much like this (taken from a typical flow using Ionic Appflow):

  1. Developer pushes commits to repository
  2. On commit, run web build and execute web unit test suite, generate web preview
  3. On success, run full native build (iOS and Android)
  4. Run full native test suite and on device tests
  5. On success, hot deploy new web code using Appflow Live Deploy, if possible
  6. Deploy final native binaries to TestFlight or App Stores if necessary

Option 1: CI/CD with Appflow

Appflow is the official CI/CD service for enterprise apps on the Ionic stack. Appflow handles the complexity of automated native app builds and provides the ability to push Live Updates to apps in realtime.

Appflow is a specialized CI/CD service focused on mobile. Compared to more general-purpose CI/CD services, Appflow provides a host of features focused on the unique challenges of mobile app development, as demonstrated in this graphic:

Appflow vs other CI/CD Services

Cloud Builds

Appflow provides quality, managed build environments for both Android and iOS apps. Teams can run new native builds manually or in a fully-automated fashion, providing rapid turnaround for native builds on multiple platforms. Appflow supports controlling the stack of hardware and software used to perform builds, so teams have full control over their environments.

App Store and TestFlight Submission

Appflow has built in functionality to automatically submit your apps to app stores and testing services such as TestFlight.

This automates one of the most time consuming and frustrating parts of building and shipping mobile apps frequently.

Live Updates

One of the magic features of Appflow is supporting remote app updates. Supported for web updates that do not require binary changes, this capability can be used to update your app, run a/b tests, deploy new features, and fix breaking issues in realtime.

Web Preview

As your app is developed and built, Appflow can build and deploy special web previews of each commit, providing a rapid sharing and previewing features when apps are built with a web environment in mind.

Option 2: Build it yourself

For teams that would prefer to build and manage their own build infrastructure, generally the approach is to take an existing general purpose CI/CD service (custom or third party), and then set up and manage Mac and Linux build environments on dedicated Mac build hardware and Linux VMs. Then build environments will be manually managed and administered by developers with server administration experience, and kept up to date with multi-year mobile operating system and device updates.

Teams could program in the ability to submit apps to the app stores though such a feature is not trivial.

Note: teams taking this approach will not be able to have real-time app updates such as those enabled in Appflow as that capability is only possible through official Ionic tooling.

CI/CD Options Compared

Here are some commonly used CI/CD services. This list isn't necessarily apples-to-apples, and many teams utilize a mixture of services for their individual unique capabilities.

Appflow

Product Page

The official Mobile CI/CD service for enterprise Ionic apps, Appflow comes with everything you need to build, update, and distribute your app.

Pros

  • Officially-supported Ionic product (with an active enterprise subscription)
  • Focused on Web Native and Hybrid apps
  • Automatic app store and TestFlight submission
  • Live code updates
  • Web Previews
  • Support for a wide variety of git providers, such as GitHub, GitLab, and BitBucket
  • Enterprise SSO and more

Cons

  • Not general purpose, mobile and web builds only
  • Runs in the cloud, for teams requiring an on-prem solution

Azure DevOps

Product Page

Azure DevOps is a set of developer services that contains features to run automated builds from your codebase. Azure DevOps is widely used and can be used in tandem with Appflow or on its own.

Pros

  • General purpose. Can be used for a variety of backend, frontend, and mobile builds
  • One-stop shop with other Azure services
  • Easy to use with Appflow for mobile builds

Cons

  • General purpose, mobile is not a focus
  • No app store submission
  • No built-in web previews
  • Build environments and scripts must be maintained manually

GitHub Actions

Product Page

GitHub Actions is a simple build service available to GitHub repositories. Build environments and processes can be configured through YAML.

Pros

  • General purpose. Can be used for a variety of backend, frontend, and mobile builds
  • Easy to configure
  • Can be used with Appflow for mobile builds

Cons

  • General purpose, mobile is not a focus
  • No app store submission
  • No web previews
  • Build environments and scripts must be maintained manually
  • Enterprise features can be expensive

In our opinion

Enterprise apps built across teams with even just a few developers will have need for a quality Mobile CI/CD pipeline.

Mobile apps are among the most complicated types of software to build, with heavy use of complex platform APIs and functionality built across multiple platforms and myriad devices. A pipeline that is regularly building, testing, and deploying these apps in a controlled manner and across all developers in the team is invaluable.

Mobile is a unique environment that requires additional functionality from your CI/CD implementation. Given that apps will run and thus need to be built and tested across multiple platforms, build environments must be set up for iOS and Android at least, and likely web as well. Build chains must be capable of supporting multiple operating systems for builds and mobile devices. Environments must be regularly updated to keep pace with rapid mobile operating system, device, and app store submission rules updates (multiple times each year). Specialized build hardware must be managed and maintained, such as genuine Mac hardware for iOS builds. Features such as app store submission must be programmed in.

Navigating the CI/CD ecosystem can be complicated, because it's not always clear which platforms have special considerations for mobile, and which ones don't. It goes the other way as well: which platforms are focused on mobile, and which ones are more general purpose?

We see Ionic enterprise developers taking a few approaches here. Many have a CI/CD pipeline they use for their web and backend builds, and many want to continue using that. In those cases, we recommend teams keep using it and integrate with Appflow to have Appflow manage the mobile specific requirements for the app, such as mobile binary builds, live updates, and app store submissions.

We also see some teams Adopting Appflow completely for their web and mobile builds. We fully support that usecase as well.

The biggest thing to consider is whether your team has the skillsets available to set up and manage build environments for iOS and Android. It's a large task requiring very different skillset than app development, so we strongly recommend teams use a specialized service like Appflow for the mobile portion of their CI/CD pipeline so they can focus on their app.

Ken Sodemann
Ken SodemannSolutions Architect

Resources