NewPlatano

Sending Over-the-Air (OTA) Updates with EAS Update | Step-by-Step Guide

Beto, November 6, 2024 · 26,374 views

Learn how to use Expo Application Services (EAS) Update to send over-the-air (OTA) updates to deployed React Native applications. You'll learn everything from setting up EAS credentials and configuring your project to building your app and sending your first OTA update.

If you want to fix bugs or add JavaScript changes without resubmitting to app stores, this guide is for you. It also explains the limitations of OTA updates, especially regarding native code changes, and how to manage update channels for different build profiles.

What's inside

  • Introduction to EAS Update and OTA concepts
  • Overview of the Snake app project used for the demo
  • Understanding native vs update layers in React Native apps
  • Installing and configuring EAS CLI and Expo account login
  • Running to set up Expo Updates
  • Configuring EAS Build with build profiles and channels
  • Building the app with EAS Build and handling Apple developer credentials
  • Troubleshooting build failures and upgrading Expo SDK

Introduction to EAS Update and OTA concepts

EAS Update is a service from Expo that lets you send JavaScript and asset updates to your app without going through app store releases. This is commonly called over-the-air (OTA) updates. It uses the open-source Expo Updates library under the hood.

You can self-host updates, but Expo's free tier is usually enough to get started. OTA updates only work for JavaScript and assets, not native code changes. This means you can fix typos or UI bugs quickly, but if you add native dependencies or change native code, you must submit a new build to the app stores.

Overview of the Snake app project used for the demo

The demo uses a Snake game app built almost two years ago, available in the Code with I projects. I references the GitHub repo for this app and mentions related courses on React, TypeScript, and React Native.

This project is a good example to test OTA updates because it’s a simple React Native app that can be built and updated using EAS services.

Understanding native vs update layers in React Native apps

React Native apps consist of two layers: the native layer and the update layer. The native layer includes compiled native code and dependencies, while the update layer contains JavaScript and assets that can be updated OTA.

OTA updates only replace the update layer. If your changes require native code updates (like adding Stripe or in-app purchases), OTA updates won’t work because they won’t be compatible with the installed native layer. You must submit a new build for those changes.

Installing and configuring EAS CLI and Expo account login

To start, install the EAS CLI globally with if you don’t have it. Then log in to your Expo account using . You need an Expo account to use EAS services; create one at expo.dev if you don’t have it.

Check your login status with . This setup allows you to manage projects and credentials through the CLI.

Running to set up Expo Updates

Run in your project directory to install the Expo Updates library and modify your app.json and package.json accordingly. This command sets up your project to support OTA updates.

I show how this command adds the necessary configuration for Expo Updates, even though the demo uses an older Expo SDK version (47), which is sufficient for the simple Snake app.

Configuring EAS Build with build profiles and channels

Next, run to create an eas.json file with build profiles like development, preview, and production. Each profile can specify a channel name used by EAS Update to target OTA updates.

Channels let you control which builds receive which updates. For example, you can send updates only to the preview channel for testing before releasing to production.

Building the app with EAS Build and handling Apple developer credentials

Build your app using (or another profile). The preview profile is recommended for testing OTA updates internally.

During the build, you’ll be prompted for your Apple developer credentials and asked to select or reuse certificates. I recommend reusing certificates to avoid clutter.

You can also select devices to install the build on, such as an iPhone 15 Pro. The build process uploads your app to Expo servers and prepares it for OTA updates.

Troubleshooting build failures and upgrading Expo SDK

The demo build failed initially due to using an old Expo SDK version (47). I show how to discard changes and upgrade Expo by running to update the SDK version.

Keeping Expo SDK up to date is important for compatibility with EAS services and to avoid build issues.

Resources

CourseReact Native course

Premium resourcePro Membership

Let's connect!

Had a win? Get featured on Code with Beto.Share your story