init
The options, the nine steps, the prompts and the JSON document of hotcodepush init, the files it edits per framework and the repair by re-run.
hotcodepush init sets a React Native, Expo, Capacitor or Cordova project up from sign-in to the first release, re-runnable at any step.
It looks for what exists and asks for the rest, and anything it cannot edit comes back as a manual step. The quickstart walks through it, and doctor checks the same setup without changing it.
| Option | Type | Description |
|---|---|---|
--android-path <dir> | string | The Android project, when it is not capacitor.config's android.path or android/. |
--framework <name> | react_native | expo | capacitor | cordova | The framework, react_native, expo, capacitor or cordova, over the one detected from package.json. |
--ios-path <dir> | string | The iOS project, when it is not capacitor.config's ios.path or ios/. |
--xcode-target <name> | string | The app target that gets the build step phase, when the iOS project has several. |
The global options --organization <id|name> and --app <id|name> name, or create, the organization and the app.
npx hotcodepush init runs the CLI without installing it. A project that ships from CI pins it as a dev dependency, npm install --save-dev hotcodepush, so every developer and every pipeline run the same version.
hotcodepush init
hotcodepush init --yes --jsonThe steps
The framework is detected from package.json's dependencies, and --framework overrides it.
The package manager is the lockfile's: bun, pnpm, yarn, or npm otherwise.
| Step | Does |
|---|---|
sign_in | Uses the stored session or HOTCODEPUSH_TOKEN, otherwise runs the login flow in place. |
organization | Takes the organization of the app hotcodepush.json names, otherwise --organization, created when it does not exist, otherwise a picker. |
app | Applies the same rule with --app, the creation carrying the detected framework. |
package | Installs the framework's SDK package with the project's package manager. |
configuration | Writes hotcodepush.json with appId and the app's default channel, or completes a partial file. |
hook | Wires the build step: the Xcode phase and the Gradle line on React Native and Capacitor, the config plugin entry on Expo, nothing on Cordova. |
signing_key | Asks whether to generate a signing key pair and runs signing-key create in place. |
build | Runs the project's build script when a release follows and the framework does not bundle inside the upload. |
release | Asks whether to publish a first release now and runs release create in place. |
A step is done, skipped when its result exists or it is for a person only, or stopped with an error code and a manual step.
A stopped step halts the steps that depend on it. The independent ones still run, and the command exits 1 with the first stopped step's code.
init never edits the app's code. On Capacitor, when no file under src/ imports the SDK, a notice after the rows names the import line to add, since an app that never imports it rolls every update back. doctor reports the same as its import check.
A second run performs only what is missing, so init is also the repair after a stopped step or a setup done by hand.
Decline the first release until the native build exists: a release published before it is never applied on it, release_older_than_binary.
Prompts and --yes
Interactively, init asks for the organization and the app, confirms once before it edits a file, then asks about the signing key and the first release.
With --yes it answers the confirmation and takes every default: your only organization and app, the file edits, no signing key and no release.
Without a terminal and without --yes, an editing step stops with confirmation_required naming the files.
With several organizations or apps and no flag, the step stops with missing_parameter.
With no credential, sign_in stops with not_logged_in and names the approval page in its manual step.
The JSON document
--json prints one document: status, complete or incomplete, and steps, one entry per step with its step, status and message.
A stopped step adds code and manualStep, one sentence naming its file.
The hotcodepush-init skill an agent installs runs init --yes --json, performs every manualStep, then runs doctor --json until it is clean. Agent skills shows the prompt.
The files init edits
Every edit is additive and marked, so a second run leaves a wired file alone and doctor passes an edit made by hand.
| Framework | package | hook |
|---|---|---|
| React Native | @hotcodepush/react-native-code-push | Adds a run-script phase in the Xcode project and an apply from line at the end of android/app/build.gradle (or .kts), HotCodePush.bundleURL() in the delegate that overrides bundleURL(), HotCodePushReactHost in MainApplication.kt, and the HotCodePushCore pod in the Podfile, then runs pod install. |
| Expo | @hotcodepush/expo-ota-updates | Adds the package to plugins in app.config.json or app.json. The config plugin wires the native projects at npx expo prebuild. |
| Capacitor | @hotcodepush/capacitor-live-updates | Adds a run-script phase in ios/App/App.xcodeproj/project.pbxproj and an apply from line at the end of android/app/build.gradle (or .kts). |
| Cordova | @hotcodepush/cordova-code-push through npx cordova plugin add | Adds nothing. The plugin wires its Gradle task and the Xcode phase itself. |
The native projects are ios.path and android.path from capacitor.config, or ios/ and android/ next to package.json. --ios-path and --android-path override them.
An edit a file has no place for stops the hook step with xcode_project or native_project and the manual step, the line to add by hand.
The SDK installation pages for React Native, Expo, Capacitor and Cordova show every line init writes.
Last updated on
Commands
The 30 commands of the hotcodepush CLI by task, from setting a project up through shipping an update to running the organization, one line each.
doctor
Every check hotcodepush doctor runs, from the configuration and the session to the build step wiring and the signing keys, each one ok, skipped or failed.