Table of Contents

1. Why mobile DevOps?

2. Automate your mobile app development lifecycle

3. Live update your app with CodePush

Why Mobile DevOps?

Unlike other platforms, mobile is a unique environment that requires comprehensive knowledge of the development lifecycle.

Before CI/CD, mobile developers must handle many tedious works in order to deliver the app to user devices. Therefore, adopting mobile DevOps process is a game-changer in the world of mobile development. It ensures smooth operations by allowing all teams to execute assigned tasks within the shortest time possible.

This article focuses on how to set up a CI/CD process with App Center and CodePush, integrating into a React Native Android app, to automate every build, test, and distribute process.

Automate Your Mobile App Development Lifecycle

Register an App Center account at appcenter.ms

Add your mobile application. In this article, I use React Native to deploy a mobile app on Android OS.

Use React Native to deploy a mobile app on Android OS

Select Build section on the left menu, then select your repository service.

Select Build section on the left menu, then select your repository service

After successfully link App Center to your project repo, it will show your repo’s branches here. You can select and Configure build for each branch.

Select and Configure build for each branch

You can configure many useful tasks like:

  • lint source code
  • run unit tests
  • run custom build scripts
  • test on real devices

Configure many useful tasks

After automating your app’s build process, you need to sign it with a keystore in order to distribute the build version to testers and users

After automating your app’s build process, you need to sign it with a keystore in order to distribute the build version to testers and users

App Center supports three different configurations of setting up code signing for Android apps. To begin, enable the Sign builds toggle in the branch configuration. Follow and read the full documentation here:

https://learn.microsoft.com/en-us/appcenter/build/android/code-signing

Finally, try to push a new commit to your repo, App Center will run a test and build a new version according to your configuration, then it will notify your users to download the newly created version of your app.

► 

Live Update Your App with CodePush

CodePush is a cloud service that enables React Native developers to deploy mobile app updates directly to their users’ devices.

This allows you to have a more deterministic and direct engagement model with your userbase, when addressing bugs and/or adding small features that don’t require you to re-build a binary and re-distribute it through the respective app stores.

Simply put, CodePush helps you deliver live updates of your React Native app to users in the following scheme:

  • Developers make some changes in Javascript code.
  • Execute CodePush CLI to push new updates to App Center (CodePush stores every JS bundle file of your app on App Center).
  • Depends on your CodePush configuration, your app will either prompt users with an update dialog or silently download a new JS bundle file and replace the old one, giving your app a fresh update.
  • In case you accidentally push an update that includes a crash, it can roll back to ensure your end-users always have a functioning version of your app.

CodePush significantly reduces many repetitive tasks like:

  • Developers don’t need to rebuild any ipa, apk or aab file.
  • Developers don’t need to upload or redistribute new versions to the store.
  • Users don’t need to manually download a new version from the store. Instead, they receive new updates on the fly.

To setup CodePush, open App Center and follow these instructions:

Setup CodePush, open App Center

I strongly advise you to read the full documentation here, or clone the example code.

In this article, I focus on some frustrating issues I got when integrated CodePush into my React Native Android app.

If your app crashes with this exception:

java.lang.IllegalStateException: Native module CodePush tried to override CodePushNativeModule. Check the getPackages() method in MainApplication.java, it might be that module is being created twice. If this was your intention, set canOverrideExistingModule=true

→ Resolve by creating a react-native.config.js file at the root of your project with the following content:

module.exports = {
  dependencies: {
    "react-native-code-push": {
      platforms: {
        android: null
      }
    }
  }
};

Follow-up GitHub issue: #1666

Cannot sync new update

When calling CodePush.sync, your app not getting updated, the status you received in callback is CodePush.SyncStatus.UNKNOWN_ERROR.

Try checking Android Studio Logcat, if you see this error:

Update is invalid — A JS bundle file named “null” could not be found within the downloaded contents. Please check that you are releasing your CodePush updates using the exact same JS bundle file name that was shipped with your app’s binary.

→ Resolve by override getJSBundleFile method of ReactNativeHost:

Resolve by override getJSBundleFile method of ReactNativeHost

After finishing the configuration, follow this CLI documentation on how to push new updates to Staging or Production.

appcenter codepush release-react -a /
Content manager
Thanh (Bruce) Pham
CEO of Saigon Technology
A Member of Forbes Technology Council

Related articles

IT Support Outsourcing: Enhancing Efficiency & Reducing Costs
Methodology

IT Support Outsourcing: Enhancing Efficiency & Reducing Costs

We cover the benefits and types of IT support outsourcing in this blog. We also cover some factors to consider when selecting a capable outsourcing partner.
Deep dive into java.time: Instant
Methodology

Deep dive into java.time: Instant

Java's Instant class is immutable, thread-safe, and ideal for time-sensitive applications needing absolute time without time zones.
Finance App Development: The Complete Guide
Methodology

Finance App Development: The Complete Guide

Explore finance app development essentials from types to key features and discover how to develop secure, user-friendly financial solutions.
Telemedicine App Development: A Complete Guide
Methodology

Telemedicine App Development: A Complete Guide

Dive into our telemedicine app development guide. Learn about essential features, development costs, monetization strategies, and key steps.
Auditing with Spring Data JPA: A Comprehensive Guide
Methodology

Auditing with Spring Data JPA: A Comprehensive Guide

Discover how to implement auditing with Spring Data JPA and Hibernate Envers to track data changes and ensure integrity in your applications.
calendar 10 Feb 2025
Real Estate App Development: Your Step-by-Step Guide
Methodology

Real Estate App Development: Your Step-by-Step Guide

Dive into real estate app development and learn key features and strategies to create an app that buyers, sellers, and renters love.
How Software Testing Outsourcing Works: A Detailed Overview
Methodology

How Software Testing Outsourcing Works: A Detailed Overview

Discover how outsourcing software testing improves quality, cuts costs, and boosts efficiency. It also speeds up product delivery, keeping you competitive.
HIPAA-Compliant App Development: Everything You Need to Know
Methodology

HIPAA-Compliant App Development: Everything You Need to Know

Learn everything you need to know about HIPAA-compliant app development. Discover key requirements, best practices, and steps. Check it now!
Mobile Banking App Development: A Complete Guide
Methodology

Mobile Banking App Development: A Complete Guide

Mobile banking app development offers unmatched convenience. Learn how to develop powerful banking apps with Saigon Technology. Read now!

Want to stay updated on industry trends for your project?

We're here to support you. Reach out to us now.
Contact Message Box
Back2Top