# Quickstart (https://hotcodepush.com/docs/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 service 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.

## AI-assisted setup (recommended) [#ai-assisted-setup-recommended]

Paste this prompt into the agent or assistant you use:

```text
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](https://hotcodepush.com/docs/ai/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](https://github.com/hotcodepush-team/react-native-code-push-demo), [Expo](https://github.com/hotcodepush-team/expo-ota-updates-demo), [NG Native](https://github.com/hotcodepush-team/ng-native-ota-updates-demo), [Capacitor](https://github.com/hotcodepush-team/capacitor-live-updates-demo) or [Cordova](https://github.com/hotcodepush-team/cordova-code-push-demo).

## Prerequisites [#prerequisites]

An existing app on a [supported version](https://hotcodepush.com/docs/supported-versions) 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](https://hotcodepush.com/docs/sdks/react-native/installation), [Expo](https://hotcodepush.com/docs/sdks/expo/installation), [Capacitor](https://hotcodepush.com/docs/sdks/capacitor/installation) and [Cordova](https://hotcodepush.com/docs/sdks/cordova/installation).

## Step 1: run init [#step-1-run-init]



In the project root, next to `package.json`:

```sh
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](https://hotcodepush.com/docs/concepts/channels).
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`](https://hotcodepush.com/docs/cli/commands/doctor) checks every step read-only. The [`init` reference](https://hotcodepush.com/docs/cli/commands/init) lists every step, flag and manual step.

## Step 2: import the SDK [#step-2-import-the-sdk]

With the default [`checkStrategy`](https://hotcodepush.com/docs/sdks/capacitor/configuration#strategies), `auto`, the SDK checks for updates at every start on its own. Nothing has to be called. React Native, Expo and Cordova need no code at all.

On Capacitor the import reports the first render, and an app that never imports it rolls every update back. `init` writes it into the entry file, so check that the file `index.html` or `angular.json` names starts with it:

```ts
import "@hotcodepush/capacitor-live-updates";
```

`sync()` runs one cycle on demand, for a button or a test. The check cadence, the strategies and every option are on the configuration page of your SDK, such as the [Capacitor configuration](https://hotcodepush.com/docs/sdks/capacitor/configuration).

## Step 3: build the app once [#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](https://hotcodepush.com/docs/concepts/compatibility) in HotCodePush with the bundle it embeds. Every other build writes the file and creates no binary.

### Capacitor

```sh
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.

### Cordova

```sh
npm run build
npx cordova prepare
npx cordova build android --release
```

The release build is signed through your `build.json`. On iOS, open `platforms/ios` in Xcode and Product › Archive. Install the build on a phone and open the app once.

### Expo

```sh
npx expo prebuild
npx expo run:android --variant release
```

A Gradle release variant is a store build. On iOS, an Xcode archive creates one, and so does EAS Build with `HOTCODEPUSH_TOKEN` in its environment. A development build with `expo-dev-client` takes no updates.

### React Native

```sh
npx react-native run-android --mode release
```

A Gradle release variant is a store build. On iOS, Product › Archive in Xcode creates one. A debug build asks Metro for its JavaScript and takes no updates.

## Step 4: ship an OTA update [#step-4-ship-an-ota-update]

Change one line in your app, then:

### Capacitor

```sh
npm run build && npx hotcodepush release create
```

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

### Cordova

```sh
npm run build && npx hotcodepush release create
```

The CLI packages `www`, one bundle for iOS and Android.

### Expo

```sh
npx hotcodepush release create --platform ios
```

Nothing to build first: the CLI runs `expo export:embed` for the platform and uploads its bundle. One run makes one release, so `--platform android` is a second run.

### React Native

```sh
npx hotcodepush release create --platform ios
```

Nothing to build first: the CLI runs `react-native bundle` for the platform and uploads its bundle. One run makes one release, so `--platform android` is a second run.

If you created a signing key in step 1, add `--private-key-path hotcodepush-private-key.pem` to `release create`, as [Sign your bundles](https://hotcodepush.com/docs/guides/code-signing#3-sign-every-upload) shows.

[`release create`](https://hotcodepush.com/docs/cli/commands/release) labels the [bundle](https://hotcodepush.com/docs/concepts/bundles-and-releases) 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](https://hotcodepush.com/docs/concepts/update-delivery) explains.

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

| Action | What happens |
|---|---|
| Close the app fully and open it | The SDK checks at start and downloads the release. |
| Close it fully and open it again | The new version runs. |

If nothing happens, see [Troubleshooting](https://hotcodepush.com/docs/troubleshooting). To apply sooner, pick another [apply strategy](https://hotcodepush.com/docs/guides/apply-strategies) or [check strategy](https://hotcodepush.com/docs/sdks/capacitor/configuration#strategies).

`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 [#next-steps]

- [Channels](https://hotcodepush.com/docs/concepts/channels) explains what a device follows, and how a `staging` channel and a tester's build fit together.
- [How an update reaches a device](https://hotcodepush.com/docs/concepts/update-delivery) walks through the channel index, the device evaluating it, the signature check and the fail-open guarantee.
- [Roll out gradually](https://hotcodepush.com/docs/guides/staged-rollouts): release to a share of the devices and let auto-pause stop a bad release.
- [Ship every commit](https://hotcodepush.com/docs/ci) has the pipeline that releases from CI with `HOTCODEPUSH_TOKEN`.
