> ## Documentation Index
> Fetch the complete documentation index at: https://docs.updatetheapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UTA CodePush CLI

> CLI for shipping React Native OTA updates with updatetheapp.com

> A fork of [Microsoft's CodePush CLI](https://github.com/microsoft/code-push-server/tree/main/cli), customized for [updatetheapp.com](https://updatetheapp.com) to ship React Native over-the-air (OTA) updates.

## Installation

```shell theme={null}
npm install -g @updatetheapp/uta-codepush-cli
```

## Getting Started

1. Generate an **API key** in the [updatetheapp.com Dashboard](https://updatetheapp.com/dashboard/settings/api-keys).
2. Sign in:
   ```shell theme={null}
   uta login --accessKey <YOUR_API_KEY>
   ```
3. Verify authentication:
   ```shell theme={null}
   uta whoami
   ```
4. Release an update:
   ```shell theme={null}
   uta release-react <appName> <platform> [--deploymentName <deploymentName>]
   ```

## Commands

### Authentication

* `uta login --accessKey <KEY>` – Authenticate using an API key.
* `uta whoami` – Display the current authenticated user.

### App Updates

* `uta release-react <appName> <platform>` – Release a React Native OTA update.
  * `--deploymentName <name>` – Deployment channel (default: `Staging`).
  * `--description <desc>` – Description of the changes.
  * `--mandatory` – Make the update mandatory.
  * `--targetBinaryVersion <version>` – Target specific binary versions.

## Migrating from App Center CodePush

Already using `react-native-code-push`? Migrating to updatetheapp.com is straightforward.

**Since updatetheapp.com uses the same client protocol, you don't need to change the `react-native-code-push` SDK package itself.**

The migration involves these main steps:

1. **Create new deployments** in the [updatetheapp.com dashboard](https://updatetheapp.com/dashboard). You'll get new deployment keys.
2. **Update your native configuration** to point to the updatetheapp.com server and use your new deployment keys.
3. **Rebuild and resubmit** your app binaries to the stores (a one-time step).

### Server URL

Point your app to the updatetheapp.com server instead of the old CodePush/App Center endpoint:

```diff theme={null}
- https://codepush.azurewebsites.net  # or App Center URL
+ https://updatetheapp.com
```

### Platform-specific configuration

You'll need to update **both** the server URL and the deployment key in your native files.

#### Android

Replace your old key and server URL (if present) with the new values:

```xml filename="android/app/src/main/res/values/strings.xml" theme={null}
<resources>
    <string name="app_name">MyApp</string>
    <!-- 👇 Use the NEW key from the updatetheapp.com dashboard 👇 -->
    <string moduleConfig="true" name="CodePushDeploymentKey">YOUR_NEW_UTA_DEPLOYMENT_KEY</string>
    <!-- 👇 Point to the updatetheapp.com server 👇 -->
    <string moduleConfig="true" name="CodePushServerUrl">https://updatetheapp.com</string>
</resources>
```

> ⚠️ The attribute name is `CodePushServerUrl` (lower-case **l**) on Android.

#### iOS

Update the deployment key and add/update the server URL:

```xml filename="Info.plist" theme={null}
<!-- 👇 Use the NEW key from the updatetheapp.com dashboard 👇 -->
<key>CodePushDeploymentKey</key>
<string>YOUR_NEW_UTA_DEPLOYMENT_KEY</string>
<!-- 👇 Point to the updatetheapp.com server 👇 -->
<key>CodePushServerURL</key>
<string>https://updatetheapp.com</string>
```

Alternatively, use Xcode *Build Settings* to manage these values (e.g., `$(CODE_PUSH_DEPLOYMENT_KEY)` and `$(CODE_PUSH_SERVER_URL)`).

## Rebuild & Resubmit

After updating your native configuration with the new server URL and deployment keys:

1. Increment your app version/build number.
2. Create a new production build (`gradlew assembleRelease` / Xcode Archive).
3. Submit the new binary to the app stores.

Once this new binary is live, all subsequent JavaScript updates can be delivered OTA using `uta release-react`.

## Original Project

Based on [Microsoft's CodePush CLI](https://github.com/microsoft/code-push-server/tree/main/cli).

## Acknowledgements & License

This CLI is adapted from Microsoft's CodePush CLI for seamless integration with **updatetheapp.com**.

**License:** MIT – see the project [LICENSE](https://github.com/microsoft/code-push-server?tab=MIT-1-ov-file) for full text.

## Feedback & Issues

Find a bug or have a feature request? Please [open an issue](https://github.com/updatetheapp/uta-codepush-cli/issues) on GitHub.
