HotCodePush

Quickstart

Run npx hotcodepush init in a React Native, Expo, Capacitor or Cordova app, build it once and ship an OTA update that reaches the phone within a minute.

HotCodePush, the over-the-air (OTA) update platform for React Native, Expo, Capacitor and Cordova, is set up with one command in your app's repository. The command npx hotcodepush init signs you in, creates the app, installs the SDK and wires the build step. Build the app once, change a line, run npx hotcodepush release create and reopen the app. The new version is running.

Paste this prompt into the agent or assistant you use:

Set up HotCodePush OTA updates in this project, following https://hotcodepush.com/docs/quickstart.md. If you can run commands, install the agent skills with `npx skills add hotcodepush-team/skills`, then run hotcodepush-init and hotcodepush-release. If you cannot run commands, read that page and give me the steps to do it myself.

An agent that runs commands installs the SDK, creates the app and the channel, and ships a first update. An assistant without a shell reads this page and hands you the steps below. Agent skills explains what the agent does.

Try it on a demo app first

Each demo is one screen showing the running release, with a button that syncs now and one that opens the debug screen. Clone React Native, Expo, Capacitor or Cordova.

Prerequisites

An existing app on a supported version of its framework, Node 22 or later, and Xcode or Android Studio for the native build. An account is created on the first sign-in, with GitHub, Google or email and password. The installation page of each SDK has the manual setup: React Native, Expo, Capacitor and Cordova.

Step 1: run init

In the project root, next to package.json:

npx hotcodepush init

The command does five things:

  1. signs you in, in the browser.
  2. picks or creates the organization and the app.
  3. installs the SDK package.
  4. writes hotcodepush.json with the app id and the channel.
  5. wires the build step into the native builds.

It shows the files it is about to change and asks once. It also offers a signing key and a first release. Decline the release for now: a release created before the build of step 3 never reaches that build.

Run init again at any time to repair a setup, and doctor checks every step read-only. The init reference lists every step, flag and manual step.

Step 2: add the SDK call

With the default checkStrategy, auto, the SDK checks for updates on its own. Import the package in the file that runs at every start, and call sync() where you want one cycle now:

import { HotCodePush } from "@hotcodepush/capacitor-live-updates";

const result = await HotCodePush.sync();
if (result.status === "downloaded") {
  console.log(`release #${result.release.number} applies at ${result.applyStrategy}`);
}

The import matters even when the automatic checks do all the work. On Capacitor it is what tells the SDK the app rendered, and an app that never imports it rolls every update back. The check cadence, the strategies and every option are on the configuration page of your SDK, such as the Capacitor configuration.

Step 3: build the app once

A store build, an Xcode archive or a Gradle release variant, runs the step init wired. It writes hotcodepush.json into the built app and creates the binary in HotCodePush with the bundle it embeds. Every other build writes the file and creates no binary.

npm run build
npx cap sync
npx cap open ios
npx cap open android

In Xcode, Product › Archive, and in Android Studio, Build › Generate Signed App Bundle / APK. Install the build on a phone and open the app once.

Step 4: ship an OTA update

Change one line in your app, then:

npm run build && npx hotcodepush release create

The CLI packages webDir from capacitor.config, one bundle for iOS and Android.

If you created a signing key in step 1, add --private-key-path hotcodepush-private-key.pem to release create, as Sign your bundles shows.

release create labels the bundle with package.json's version, states the devices the release reaches and asks once, then uploads and prints the release number. The release applies within about a minute, as How an update reaches a device explains.

With the default strategies, the new version runs at the second cold start:

ActionWhat happens
Close the app fully and open itThe SDK checks at start and downloads the release.
Close it fully and open it againThe new version runs.

If nothing happens, see Troubleshooting. To apply sooner, pick another apply strategy or check strategy.

npx hotcodepush open opens the app's page in the console, where the device's report and the update show within a minute.

Next steps

  • Channels explains what a device follows, and how a staging channel and a tester's build fit together.
  • How an update reaches a device walks through the channel index, the device evaluating it, the signature check and the fail-open guarantee.
  • Roll out gradually: release to a share of the devices and let auto-pause stop a bad release.
  • Ship every commit has the pipeline that releases from CI with HOTCODEPUSH_TOKEN.

Last updated on

On this page