Skip to content
CodeOnAir
Docs menu

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.

Terminal
npm install -g @codeonair/code-push-cli@beta
codeonair-codepush --help

Authentication#

Terminal
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:

VariableMeaning
CODEONAIR_ACCESS_KEYYour CLI access key (cak_…).
CODEONAIR_SERVER_URLThe 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:

Terminal
codeonair-codepush app list
codeonair-codepush app info shop-android -k   # latest release, deployment key and server URL

Release#

Terminal
# 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"
OptionMeaning
-t, --targetBinaryVersionBinary versions to target: 1.2.0, 1.2.x or * (default: the version in build.gradle / Xcode). Fixed once released.
-m, --mandatoryUsers must install it (installs immediately by default).
-d, --descriptionRelease notes, shown in the dashboard and the update dialog.
-r, --rolloutPercentage of devices, e.g. 20. Raise it later with patch.
-x, --disabledUpload without releasing; enable it later with patch.
--useHermes true|falseCompile to Hermes bytecode (default: what your app uses).
-e, --entryFileEntry file (default index.js).
-o, --outputDirKeep the bundle in this folder.

Change a release#

Terminal
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
Note
A release's target binary version can't be changed — devices on other versions may already have been told there's no update. To ship the same fix to another version, release it again with a new -t.

Roll back and history#

Terminal
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.

Stuck? Write to support@codeonair.com with your App ID and what you tried — we reply within a working day.