Skip to content
CodeOnAir
Docs menu

Quick Start

Your first CodePush over-the-air update for React Native in about ten minutes: set up, install the SDK, release with the CLI and watch it install.

This walks through one Android release end to end. iOS is the same with the iOS deployment and an Xcode Release build.

  1. Set up CodePush — sidebar → CodePush → Android → Set up CodePush. Copy the deployment key.
  2. Set up your project — keys, MainApplication / AppDelegate and CodePush.sync() on launch (Project Setup). Build a release build and install it on a phone: npx react-native run-android --mode release.
  3. Note the app version on that build — versionName in android/app/build.gradle (iOS: Xcode → target → General → Version). Releases only reach phones whose version matches -t.
  4. Create a CLI access key — your avatar at the top right → CLI access keys → Create key (details).
  5. Install the CLI and log in (@codeonair/code-push-cli on npm):
    Terminal
    npm install -g @codeonair/code-push-cli@beta
    codeonair-codepush login --serverUrl https://app.codeonair.com
  6. Change some JavaScript — a text on the home screen is easiest to spot — and release it:
    Terminal
    codeonair-codepush release-react shop-android --targetBinaryVersion 1.0.0
  7. Open the app twice (release build): the first launch downloads the update, the next one runs it.
  8. Watch it in the dashboard — CodePush → Android lists every release with its installs; click one for downloads, installs and devices. Next time, try a small share first with --rollout 20.
CodePush → Android after a few releases. Switches turn a release on or off and make it mandatory; Roll back is at the top of the list.
Click a release to see how it's doing and to change its rollout, mandatory flag or description.

Mandatory vs optional updates#

Updates are optional by default and run on the next restart. Add --mandatory for fixes that can't wait — they install and restart right away. A device that skipped a mandatory release gets the next one as mandatory too.

Terminal
codeonair-codepush release-react shop-ios -t 1.0.0 --mandatory -d "Fix checkout"

Rollback & versioning#

Terminal
codeonair-codepush rollback shop-ios
codeonair-codepush history shop-ios

A rollback adds a new release with the previous bundle, so devices move back on their next check. Releases are labelled v1, v2, …

Note
After a release, devices pick it up on their next update check — usually the next app start.
Stuck? Write to support@codeonair.com with your App ID and what you tried — we reply within a working day.