CodePush is a cloud service that enables Cordova and React Native developers to deploy mobile app updates directly to their users’ devices. It works by acting as a central repository that developers can publish certain updates to (e.g. JS, HTML, CSS and image changes), and that apps can query for updates from (using our provided client SDKs). This allows you to have a more deterministic and direct engagement model with your end-users, while addressing bugs and/or adding small features that don’t require you to re-build a binary and/or re-distribute it through any public app stores.
1. Install the CodePush CLI
You manage your CodePush account using our NodeJS-based CLI. To install it, open a command prompt or terminal, and type
npm install -g code-push-cli
Note: On OSX and Linux, you may need to prefix this command with
2. Create a CodePush account
Before you can release any updates, you first need to create a CodePush account. To do this, simply type the following command via the CLI and authenticate with either your GitHub or Microsoft account:
3. Register your app with the service
In order to let the service know about your app, simply register it using a recognizable name. For example:
code-push app add MyApp
4. CodePush-ify your app
Add the appropriate CodePush client SDKs to your app, and configure them to query for updates against the app deployment created above. The following provide details on how to do this for each unique app type:
5. Release an app update
After making changes to your app’s code or assets, push the update to your staging environment by using the CLI command which corresponds to the app type you are building (React Native or Cordova), and specifies the name of your CodePush app and the platform that your update is targetting (iOS or Android).
code-push release-react MyApp ios.
code-push release-cordova MyApp android.
6. Run your app
And that’s it! All users running your app will receive the update using the experience you configured in step #4. For more details, refer to the CLI and client SDK documentation (Cordova, React Native).