CLI quick reference
Copy-paste CodePush CLI commands for auth, releases, and rollouts
Examples use placeholder app names MyApp-Android and MyApp-iOS—replace them with your registered CodePush apps. Platform arguments for release-react are android or ios.
All bundle uploads and release changes go through the CLI (locally or in CI), not the Codemagic UI. For install options and client-side APIs, see Advanced: sync options.
Install and version check
npm install -g @codemagic/code-push-cli
code-push --versionSee Setup for full installation and server configuration.
Authentication
code-push login "https://codepush.pro" --accessKey $CODEPUSH_ACCESS_KEYSee Security and access for keys and token handling.
Apps and deployments
Register an app (creates Staging and Production deployments):
code-push app add MyApp-Android
code-push app add MyApp-iOSList apps:
code-push app listList deployments and deployment keys (-k):
code-push deployment list MyApp-Android -kPublish a React Native bundle (release-react)
Default deployment is usually Staging if you omit a deployment flag (confirm with code-push release-react --help for your CLI version).
Android
code-push release-react MyApp-Android androidiOS
code-push release-react MyApp-iOS iosCommon options (combine as needed):
code-push release-react MyApp-Android android -d Production --targetBinaryVersion "1.2.x" --description "Short release notes" --mandatory --rollout 25| Flag | Purpose |
|---|---|
--targetBinaryVersion | Limit which store app versions may install the update |
--description | Release notes (for example shown in an in-app update dialog) |
--mandatory | Treat the release as mandatory on supported clients |
--rollout <n> | Deliver to approximately n percent of users |
See Releasing updates and Production control for workflows, constraints, and examples.
Promote between deployments
Promote an existing release from one deployment to another without rebuilding or creating a new bundle.
code-push promote MyApp-Android Staging ProductionPromotion allows you to safely move tested updates between environments without rebuilding or modifying the original release.
Change rollout on an existing release
Update the rollout percentage of an existing release without creating a new one using the patch command.
code-push patch MyApp-Android Production --rollout 50See Production control for rollout rules and limits.
Roll back a deployment
To revert a deployment to the previous release, use the rollback command.
code-push rollback MyApp-Android ProductionThis will deactivate the current release and restore the previously active version for the specified deployment. See Production control.
Device debug logs (Android)
code-push debug androidRequires a connected device, adb, and a single Android target. For iOS simulator requirements and log interpretation, see Issues and debugging.
Full flag lists
Run code-push --help and code-push <command> --help for the authoritative option list for your installed CLI version.