CodeOnAir CodePush CLI
Install and log in to the codeonair-codepush CLI, then release React Native updates, change rollouts, roll back and read release history.
codeonair-codepush bundles your React Native app (compiling Hermes bytecode when your app uses Hermes), uploads it, and manages releases.
Installation#
The CLI is in beta and on npm as @codeonair/code-push-cli (currently 0.10.0). Install it globally; the command is codeonair-codepush.
npm install -g @codeonair/code-push-cli@beta codeonair-codepush --help
Authentication#
codeonair-codepush login --serverUrl https://app.codeonair.com codeonair-codepush whoami codeonair-codepush logout
login opens the dashboard's access keys page (how to create one) — create a key and paste it. The key is saved in ~/.codeonair-codepush.json. In CI, set environment variables instead of logging in:
| Variable | Meaning |
|---|---|
CODEONAIR_ACCESS_KEY | Your CLI access key (cak_…). |
CODEONAIR_SERVER_URL | The server, https://app.codeonair.com. |
App names#
The CLI names each deployment <app>-android or <app>-ios, where <app> is your app's default subdomain. List them:
codeonair-codepush app list codeonair-codepush app info shop-android -k # latest release, deployment key and server URL
Release#
# Optional update for app version 1.0.x codeonair-codepush release-react shop-android -t 1.0.x -d "Fix the cart badge" # Mandatory fix, to 20% of devices first codeonair-codepush release-react shop-ios -t 2.3.0 --mandatory --rollout 20 -d "Fix checkout crash"
| Option | Meaning |
|---|---|
-t, --targetBinaryVersion | Binary versions to target: 1.2.0, 1.2.x or * (default: the version in build.gradle / Xcode). Fixed once released. |
-m, --mandatory | Users must install it (installs immediately by default). |
-d, --description | Release notes, shown in the dashboard and the update dialog. |
-r, --rollout | Percentage of devices, e.g. 20. Raise it later with patch. |
-x, --disabled | Upload without releasing; enable it later with patch. |
--useHermes true|false | Compile to Hermes bytecode (default: what your app uses). |
-e, --entryFile | Entry file (default index.js). |
-o, --outputDir | Keep the bundle in this folder. |
Change a release#
codeonair-codepush patch shop-android --rollout 100 # latest release to everyone codeonair-codepush patch shop-android --label v7 -m true # make v7 mandatory codeonair-codepush patch shop-android --label v8 -x true # disable v8
-t.Roll back and history#
codeonair-codepush rollback shop-android # back to the previous release codeonair-codepush rollback shop-android --targetRelease v5 # back to v5 codeonair-codepush history shop-android # every release with installs and rollbacks
A rollback adds a new release that carries the earlier bundle, so devices move back on their next check.