Mobile CI/CD: a beginner’s guide for mobile app developers

CI/CD practices have taken the software development world by storm, and for good reason. Time and again, research proves the benefits of implementing CI/CD. Take this paper from the University of Helsinki, for example, which shows how a company achieved faster iterations, better assurance of quality, and easier deployments with CI/CD.

But mobile is a unique beast with its own benefits and challenges.

Whether you’re a newbie or a more experienced mobile developer looking to broaden your skills, having an understanding of what CI/CD entails makes you more valuable in today’s software development world. This beginner’s guide to CI/CD mobile app development is ideal for mobile app developers who are getting familiar with this topic.

In this article you’ll learn about:

  • What CI/CD means in simple terms
  • How CI/CD fits into the Mobile DevOps lifecycle
  • The benefits of CI/CD for mobile app development
  • Factors to consider when selecting a CI/CD tool for mobile app development
  • Which CI/CD tools should you use: self-hosted or SaaS-based?
  • Best practices to keep in mind for setting up CI/CD for mobile development
  • Do more with less: set up a basic CI/CD pipeline for your mobile app using Bitrise

What CI/CD means in simple terms

CI/CD stands for continuous integration and continuous delivery. In a nutshell, it is the practice of automating as much of the manual effort as possible required to get new code from the developer’s IDE into the hands of users. As a result, teams are able to deliver apps faster and with ease.

To get a better understanding of what CI/CD entails, we need to discuss both components — continuous integration and continuous delivery — separately.

What is continuous integration (CI)?

Continuous integration is a development practice where developers frequently (at least daily) commit code in small changes to a shared version control repository, and then the viability of each code commit is verified using automated checks.

Consider a typical development process. After the analysis and design phase, different developers are assigned to work on different features or functionalities. Each developer gradually commits code to their own branch (e.g., 2841-add-new-button-to-settings-page), and when they’ve reached a milestone, they’ll make a ‘Pull Request (PR)’ to merge their code into the main development branch.

To avoid committing or merging defective code into the main development branch, developers would have to check out each code commit locally, create a build, and run the tests on their laptop, which could take anywhere from 30–120 minutes. This is where CI proves useful.

A CI tool can be used to trigger a CI pipeline whenever a commit or PR is opened to build and test the app and confirm that the code changes do not contain any defects or software quality concerns. As a result, developers can get feedback on the status of their code change faster and do not have to waste valuable time manually running tests.

With continuous integration in place, it’s easier to identify and fix defects and other software quality issues before they ever get to production. This practice leads to better end-user software quality and easier collaboration amongst developers on a team.

A CI process (pipeline) will typically:

  • Compile the existing source code of the branch with the new code addition alongside required libraries and dependencies to produce a ‘build.’
  • Run automated checks or tests (such as unit tests, integration tests, static analysis, linting) on the compiled code to ensure that the app builds and that the code addition hasn’t broken the app.
continous-integration.png

What is continuous delivery (CD)?

After merging working code into the central branch (main, master, etc.), continuous delivery picks up where continuous integration stops to automate the delivery of builds that pass the CI checks into production-like environments (e.g., staging), where further tests and review will be done to prepare them for release to the actual production environment.

Tests such as performance, security, acceptance, and smoke tests that require a full delivery environment are often integrated into the CD pipeline and executed after builds are delivered to target production-like environments.

By delivering working code to production-like environments for further testing and review, continuous delivery decreases the risks associated with deploying software to live and increases confidence that the app will work in production.

A CD process will typically:

  • Pull the latest code from a specified version control branch and execute a build. Some may release/push to staging as soon as a PR is merged, while others may do this on a schedule (e.g., 10 a.m. on Mondays).
  • Configure the code with environment variables for the target production-like environment (staging, testing) and deploy it.
  • Run further automated tests (UI tests, end-to-end tests, performance tests). Most teams make provisions at this stage for QA engineers to carry out some manual verification tests.
  • Based on a team’s setup, run one more build and test pipeline on the main branch and either create an artifact that can then be deployed to production at the click of a button at any time or ‘promote’ the build from staging to production.
continous-delivery.png

How CI/CD fits into the Mobile DevOps lifecycle

If you’ve heard of CI/CD, then you’ve also heard of the accompanying buzzword “DevOps”. But, if you ask five different people, you’d probably get five different definitions of what DevOps is. To understand how CI/CD fits into DevOps, let’s try to understand what DevOps is.

DevOps is the combination of “development” and “operations.” It is a methodology that combines software development with deployment and operations. Teams within organizations that were siloed before now work cross-functionally with shared ownership to get software to end-users smoothly and quickly.

In previous settings, the development team builds and tests features in a silo and then hands the complete feature over to operations to deploy. Then, operations migrates the app to production and deploys it. Sometimes there would be a case of ‘it works on my computer but doesn’t work as expected on the deployment environment.’ This arrangement caused a lot of friction and had the development team waiting for long periods for feedback, which extended deployment timelines. Hence, DevOps was born.

The DevOps approach breaks down this imaginary wall so that both teams can work simultaneously, with each team feeding off the output of the other team with the following principles in mind: shared ownership (of reliability and business impact), workflow automation, and rapid feedback. With DevOps, apps are built and tested incrementally to ensure the ongoing integrity of the codebase.

cd.png

As shown in the image above, CI/CD is the core enabler of the DevOps approach. CI/CD pipelines remove the traditional roadblocks and automate the process of handing off of code from development to operations.

Here at Bitrise, the DevOps philosophy adapted to the uniqueness of mobile development is what we refer to as Mobile DevOps. Read more about why Mobile DevOps is a necessity for mobile app development teams.

The benefits of CI/CD for mobile app development

In mobile app development, the cost of bugs in production is higher than in traditional software development. Fixes take longer because deployment is slower and gated by app store approvals, and even when fixes are released, there’s no guarantee that users will update to the latest version of your app. As a result, while CI/CD is beneficial to any development workflow, it is critical for mobile apps.

With CI/CD in a mobile app development workflow, you’ll get:

  • Higher-quality code and operations: Frequent testing of code in smaller batches and earlier in the development cycle reduces the risk of deploying bugs to production.
  • Instant rollbacks: With CI/CD in place, there’ll be several versions of code in a deployable state, so rolling back to a previous version in the event of a problem is as simple as routine push-button action.
  • Automate repetitive tasks and save time: According to a recent study, CI/CD saves mobile app teams up to 20% of development time.
  • Faster time to market: In the mobile world, time to market is everything because competition is fierce. With a robust mobile CI/CD pipeline, you can take care of all the common complexities and repetitive tasks that usually set deployments back. This way, you can get fixes and features out to users faster and get more frequent feedback from them.
  • More productive developers: Research shows that continuous delivery measurably reduces team burnout. With more of the deployment process automated, the team has time for more rewarding projects. Less burnt-out developers leads to more productive developers, which leads to higher job satisfaction.

Factors to consider when selecting a CI/CD tool for mobile app development

There is a wide variety of CI/CD tools that can be used for mobile app development. However, since building for mobile has its own unique challenges, it’s best to adopt tools that are tailored specifically for mobile like Bitrise.

With such tools, you get everything you need to make setting up a CI/CD pipeline for mobile a breeze. You get predefined templates for common mobile workflows and actions, as well as robust support and coverage for all mobile languages and platforms.

Whichever mobile CI/CD pipeline tool you choose, make sure it’s one that aligns with the needs of your team.

  • Hosting: Is the service on-premises or SaaS-based? If it’s the former, what are the software and hardware requirements?
  • Platform support: Does it provide support for all the languages/platforms you’ll be building with and deploying on?
  • Configuration: How easy is it to set up? Is there a UI-based option, or is everything handled by a configuration file (e.g., YAML)?
  • Integrations and customizations: Does it have a programmable API that can be used to customize functionality to fit your process? Can it integrate with your present toolchain with minimal overhead?
  • Concurrency: What is the maximum number of builds that can be executed at the same time, and at what cost? Some mobile CI/CD providers offer free or low-cost subscription options with limited concurrency, but costs increase significantly if you need more throughput and better performance.
  • Pricing: How robust is the pricing of each tier? How many individual projects can you develop on each tier?
  • Support: How comprehensive is the documentation? Does it have active communities or dedicated support for paying customers, so you’ll definitely get help when you need it?

Which mobile CI/CD tools should you use: self-hosted or cloud-based?

One of the most frequent questions people (especially enterprise organizations) ask when they’re about to adopt mobile CI/CD is whether a SaaS-based solution is right for them.

Based on our survey of hundreds of developers from our user base and experts from companies such as EPAM, Nextdoor, Pulselive, Compass, and Signify, 89.8% of participants saw a performance increase switching from an on-premise tool like Jenkins to a SaaS-based continuous integration tool like Bitrise.

Let’s do a brief comparison based on different factors of both hosting methods:

image.png
Factor Self-Hosted (on-premise) CI/CD Cloud-based CI/CD
Setup Setup is hard and costs more money and time.
To set up an on-premise CI/CD, you’d have to:
purchase hardware, update the operating system, update Xcode/Android, update the mobile toolchain, manage authentication and authorization, and handle operational costs (electricity and cooling).
No tedious setup process. All you have to do is pay a subscription fee, and you’re good to go.
Security You are responsible for the whole CI system’s security. You must ensure a secure, isolated environment, respond quickly to zero-day disclosures, and implement robust access control mechanisms. Security, isolation, updates are handled by the SaaS provider.
Need for dedicated hire There is usually a need to hire dedicated staff to handle the increased responsibility that may fall beyond the competencies of your team, increasing the total cost of ownership. No need for dedicated hire because the CI/CD provider will take care of everything that pertains to the CI/CD. You still need a champion to advocate for Mobile DevOps! 🙂

If you’d like to learn more, read our article on the differences between SaaS-based CI/CD and self-hosted CI/CD.

Best practices to keep in mind for setting up CI/CD for mobile development

Start with culture

Tools and automated checks are all fine. But if your developers only commit weeks’ worth of code, the team will spend a good amount of time merging branches and resolving code incompatibilities that will arise eventually.

For mobile CI/CD to work for your organization, developers have to adopt the practice of committing their code frequently (at least daily). Everyone should get into the habit of splitting the task they are working on into smaller tasks. Merge code very often and pull very often.

Keep CI checks short

The fundamental goal of CI is for developers to be able to get near-instant feedback on the status of their code. Therefore, try to keep CI checks at a max of seven minutes. If a CI check takes too long to complete, developers are likely to move on to another task. What happens after waiting, say 15 minutes, and the check fails? Now they’ll have to switch context back. This is frustrating and hampers productivity.

The checks you run at the CI stage should check the bare minimum, which is that:

  • The app should build
  • Critical features (user signup/login journey and key business features) are functional
  • Common layers of the application that all developers rely on are stable


Tests that take longer to run or are not significant to the essence of CI should be moved to the CD stage. Here are things you can do to optimize your pipelines and make them shorter:

  • Cache app dependencies: Every new build in a mobile CI/CD pipeline will typically run in a new virtual machine (VM). As a result, fresh VMs must be created from the start each time. It costs a lot of time to download dependencies every time you perform a build. You can cache dependencies during the build process to speed up your workflow.
  • Run build jobs in parallel on multiple VMs: The majority of build jobs (or steps), such as tests, are run sequentially. However, if you split long build processes into different steps and execute them all at the same time, the build takes less time to complete.
  • Build and test only what’s actually changed: Modern build tools can avoid redundant work through the reuse of build and test results from previous builds for a dramatic impact on build speeds.


If you’d like to learn more about optimizing mobile CI pipelines, here are more in-depth articles we’ve written on the topic:

Do more with less: set up a basic CI/CD pipeline for your mobile app using Bitrise

Now that you know all the theoretical fundamentals of CI/CD, you’re ready to get your hands dirty by setting up a simple mobile CI/CD pipeline of your own with Bitrise.

Bitrise satisfies all of the criteria outlined in the ‘factors to consider when selecting a CI/CD tool for mobile’ section. It caters specifically to mobile and offers a robust ecosystem with everything you need to succeed with CI/CD for mobile.

Whether you’re building for Android or iOS or working cross-platform, setting up a basic CI/CD platform on Bitrise is a simple four-step process:

  1. Sign up for a Bitrise account with your git provider, email, or SSO. Bitrise has a robust free plan, so you can sign up now, find what works for you, and choose a plan later.
  2. Login to your Workspace. A Workspace is an environment that allows you to manage your Bitrise apps and the team members working on the apps. 
  3. Set up access to your app’s repository. During this process, we also run our project scanner to detect the platform of your app (e.g., iOS) and generate default workflows with all the necessary steps you need to build and deploy your app.
  4. Follow our different guides to further customize your workflows to meet the specific needs of your app and platform type.

Happy building!

The Importance of Automating Your Mobile CI/CD Pipeline

g!

The Importance Of Automating Your Mobile CI/CD Pipeline

 

83% of developers are releasing code faster than they did in 2021, requiring new innovations to stay ahead of the curve — including mobile CI/CD

The Rapid Rise Of Mobile CI/CD Pipelines

  • CI/CD: Continuous integration, continuous delivery, and continuous deployment
    • A method that automates much or all of the manual human intervention traditionally needed to get new code from a commit into production
  • Companies are working towards fully implementing best practices
    • 55.7% - Continuous integration
    • 34.3% - Continuous delivery
    • 21.4% - Continuous deployment
    • 10.1% - Continuous security
  • Today, 24% of DevOps processes are fully automated
    • Up from 19% in 2021
    • Up from 8% in 2020

But not everyone has fully embraced the power of CI/CD, including mobile app developers

An Automated Mobile CI/CD Pipeline Is Needed Now More Than Ever

  • The demand for mobile apps has never been higher
    • There are roughly 7.33 billion mobile users worldwide
    • More than 255 billion mobile apps were downloaded worldwide in 2022
    • The demand for mobile app developers will rise from 17% to 24% by 2026
  • This has lead to a greater demand for speed
    • 60% of developers say code moves into production faster than in previous years
    • 35% of developers say they are releasing code twice as fast as they did in 2021
      • 15% are releasing code three to five times faster
  • But real world complications significantly effect mobile app development
    • The need for specialized mobile development skills introduces labor shortages and a high demand for engineers with Mobile DevOps experience
    • The growing mobile industry introduces additional security threats
    • The increased customer demands and expectations lead to high uninstall rates and the increased challenged to meet evolving customer needs
  • Which creates an unforgiving environment for mistakes in the mobile space
    • Buggy releases may be more difficult to detect, tanking your ratings and pushing users away
    • Data entry with no further verification steps has an error rate of up to 4%
  • And raises the stakes with higher inflationary costs
    • Salaries, benefits, and even cloud-based service platforms are set to rise
    • However, 85% of SaaS companies have not raised their prices to match

Today, 35% of developers say a CI/CD pipeline is fully onboarded at their organization, reaping the benefits in more ways than one

The Benefits of Mobile CI/CD in the Rapidly Changing Mobile Ecosystem

  • Mobile app developers who are leveraging CI/CD are —
    • Able to catch bugs earlier, before the app reaches production
      • 50% of workflow failures occur in an hour or less
    • Able to provide seamless mobile experiences that exceed growing customer expectations
      • Faster releases lead to better ratings and more engaged customers
    • Prepared for faster release times
      • 80% of all workflows using CI complete in 10 minutes or less
    • Staying up-to-date with the rapidly changing mobile ecosystem
      • Mobile CI/CD automates manual development tasks, helping mobile engineers focus on releasing better apps, faster
    • More likely to be successful
      • Elite developers who meet their reliability targets are:
        • 3.7 times more likely to use continuous testing
        • 4.1 times more likely to use continuous delivery
        • 5.8 times more likely to use continuous integration
    • Increasingly confident
      • According to developers, CI/CD has helped to:
        • Simplify maintenance and upgrades (8.7%)
        • Enhance test reliability (8.3%)
        • Increase developer satisfaction (7.2%)
        • Boost customer satisfaction (6.3%)
        • Reduce overall costs (5%)

When it comes to Mobile DevOps, the need for speed is rivaled by the need for confidence — Barnabás Birmacher, founder and CEO of Bitrise

How Bitrise is Changing the Game for Automated Mobile DevOps

 

  • Bitrise is a mobile DevOps platform built around industry-leading mobile CI/CD
    • 100K+ developers
    • 2M+ builds per month
    • 6K+ customers
    • $95M+ in funding
  • Made by developers, for developers
    • Works with 6,000 mobile companies
    • 50% of which are mobile unicorn startups
    • Acts as a 1-screen solution for:
      • Mobile processes
      • Mobile builds
      • Mobile workflows
  • Supports native and cross-platform development
    • iOS
    • Android
    • Flutter
    • React Native
    • Cordova
    • Ionic
  • With a cutting-edge Mobile CI/CD offering
    • Build and test caching
    • Advanced build pipelines management
    • Release management
    • High performing Apple silicon M1 machines
  • With 350+ Steps and integrations to:
    • Automate code signing and provisioning
    • Cache builds, tests, and dependencies
    • Set up notifications to Slack
    • Automate app releases to the App Store and Play Store

It’s time to automate, test, and release apps with confidence through a fully-hosted mobile CI/CD

 

Sources

https://bitrise.io/about
https://about.gitlab.com/developer-survey
https://opin.com/manual-entry-data-extraction-v2
https://about.gitlab.com/blog/2020/07/16/ci-cd-changing-roles
https://services.google.com/fh/files/misc/state-of-devops-2021.pdf
https://www.mobileappdaily.com/hiring-mobile-application-developers
https://www.activestate.com/resources/datasheets/ci-cd-survey-results
https://www.statista.com/statistics/218984/number-of-global-mobile-users-since-2010
https://circleci.com/blog/what-does-the-change-fail-rate-tell-us-about-high-performing-teams
https://www.blueridgepartners.com/insights/current-saas-pricing-is-leaving-money-on-the-table
https://www.statista.com/statistics/271644/worldwide-free-and-paid-mobile-app-store-downloads
https://www.forbes.com/sites/garydrenik/2021/08/24/meet-the-company-powering-app-creation-for-50-of-the-worlds-mobile-unicorns

Get Started for free

Start building now, choose a plan later.

Sign Up

Get started for free

Start building now, choose a plan later.