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

# Troubleshooting and debugging

> Diagnose common OTA issues with cmpatch doctor, logs, and integration checks.

When an update does not install or behaves unexpectedly, the cause is usually a configuration mismatch, version targeting problem, SDK integration issue, or bundle error.

## Debugging tools

### `cmpatch doctor`

  <TabItem value="react-native" label="React Native">

Run the read-only setup checks from your React Native or Expo project:

```bash
cmpatch doctor
cmpatch doctor --platform ios --app MyApp-iOS --deployment Staging --verbose
```

Doctor inspects both configured platforms by default: SDK settings, native/JS integration signals, control-plane access, and the configured download endpoint. No published release is required. Passing source checks do not establish that a device executed those paths.

To also inspect published delivery manifests and advertised bundle/patch accessibility:

```bash
cmpatch doctor --verify-delivery
cmpatch doctor --verify-delivery --platform ios --target-binary-version 1.2.3
```

Add `--current-package-hash <hash>` only with `--verify-delivery` to follow the lookup for an installed OTA baseline. No eligible release or an instruction to use the embedded bundle leaves artifact verification incomplete; it does not indicate an installation failure. These probes do not validate signatures, file integrity, or installation on a device.

The report separates setup and delivery coverage. Exit code **0** means no confirmed failure; unresolved checks can still leave coverage incomplete. Exit **1** indicates a confirmed diagnostic failure or a failed requested configuration fix. Usage errors return **2**, and interruption returns **130** (SIGINT) or **143** (SIGTERM). In CI, inspect `coverage.setup` and `coverage.delivery` in `--format json` as well as the exit code.

If native target selection is ambiguous, use `--platform ios --plist-file <path>` or `--platform android --android-strings-file <path>` to inspect a specific file. `--platform android --gradle-file <module>/build.gradle` selects a custom Android module. Dynamic Expo configuration, final Gradle merging, full Xcode build-setting evaluation, and custom JS aliases may remain unresolved. Doctor does not execute project configuration or run prebuild. A resolved Android resource check may include an informational notice that the final Gradle build was not evaluated; that notice alone does not make setup incomplete.

The optional `--fix --server-url https://patch.example.com` workflow can create a **missing** `codemagic-patch.config.json` with that explicit server URL after a successful readiness check. It previews the file and value, asks for confirmation, and reruns diagnostics. Existing files and package-level server settings are preserved. JSON, redirected output and CI never prompt; add `--yes` to apply this limited fix. This saves a CLI default; native SDK edits, login, installation and publication remain separate actions.

  </TabItem>
  <TabItem value="capacitor" label="Capacitor">

Run `cmpatch-capacitor doctor` from the app's root. It checks the app's Patch configuration, the server and the download origin:

```bash
cmpatch-capacitor doctor
cmpatch-capacitor doctor --platform android --verbose
```

Add `--verify-delivery` to check the published manifest and artifacts for the app's version too.

Among other things, doctor reports:

- A `deploymentKey`, `apiUrl` or `downloadBaseUrl` that is missing, malformed, or differs from the server's
- A native override (`CodemagicPatchDeploymentKey` and others) that replaces the config value, or one only the build decides (a Gradle `resValue`, a product flavor, an Info.plist `$(SETTING)`). Doctor reports those as unresolved rather than guessing; pass `--platform` with `--app` and `--deployment` to check against a specific deployment
- iOS and Android sharing one deployment key
- A synced `capacitor.config.json` that is stale or missing (run `npx cap sync`), or a plugin missing from the synced plugin registration
- Web sources that never call `start()` (or `sync()` and `notifyAppReady()`), and an unbuilt `webDir`

Doctor cannot see the installed build. Check that the release's target binary version matches the version installed on the device.

Then check device logs and `cmpatch-capacitor release inspect` as described below.

  </TabItem>
</SdkTabs>

### Server logs

```bash
docker compose --project-name codemagic-patch-selfhost --env-file .env.selfhost \
  -f docker-compose.selfhost.yml logs --tail=200 server
```

### Device logs

Trace the update lifecycle on device:

```text
check for update → download bundle → install → restart
```

- Android: `adb logcat`, filter for Patch logs. The React Native SDK warns once, under the `CodemagicPatchModule` tag, when `CodemagicPatchDeploymentKey` is missing or blank, so no update can be found in that build. The Capacitor SDK logs configuration errors under the `CodemagicPatch` tag; release builds show them only with `loggingBehavior: "production"` in `capacitor.config.ts`
- iOS: Xcode console for simulator or connected device

### Release inspection

  <TabItem value="react-native" label="React Native">

```bash
cmpatch release inspect --app MyApp-iOS --deployment Staging --label <label> --wait
cmpatch release list --app MyApp-iOS --deployment Staging --format table
```

  </TabItem>
  <TabItem value="capacitor" label="Capacitor">

```bash
cmpatch-capacitor release inspect --app MyApp-iOS --deployment Staging --label <label> --wait
cmpatch-capacitor release list --app MyApp-iOS --deployment Staging
```

  </TabItem>
</SdkTabs>

When a release reports failed devices, `cmpatch release metrics --format json` counts them by reason under `failure_reasons`. `cmpatch release failures --label <label> --reason <reason>` breaks one reason down by code (for `network`, the HTTP status, or `0` when no response arrived), adding `--code <code>` shows that code's most common messages and Android exit reasons, and `--no-code` does the same for failures that reported no code. `cmpatch release failure-events` with the same `--reason` and `--code` (or `--no-code`) lists the raw events, with the device ID and message of each. For a Capacitor app, `cmpatch-capacitor` has the same commands.

### HTTP API spot checks

The CLI and dashboard both call the same REST API under `/v1`. You do not need to call it directly for normal workflows, use `cmpatch` or the dashboard instead. These checks help when CI auth fails, the server looks unreachable, or you want to confirm what the server returned.

**Health (no auth):**

```bash
curl -sS https://updates.example.com/health
curl -sS https://updates.example.com/health/ready
```

`/health` confirms the process is up. `/health/ready` also checks Postgres and storage connectivity (returns `503` if a dependency is down).

**Authenticated check:**

```bash
curl -sS https://updates.example.com/v1/users/me \
  -H "Authorization: Bearer $CODEMAGIC_PATCH_TOKEN"
```

Use a `cm_pat_…` token from `cmpatch token create`. A `200` confirms the server URL and token are valid. `401` with `authentication-required` usually means a missing, expired, or wrong token.

**Reading errors:** Failed API calls return `application/problem+json` (RFC 7807) with `type`, `title`, `detail`, and `status`. The `type` URL often ends with a short suffix, useful ones when debugging:

| Suffix | Usually means |
| --- | --- |
| `authentication-required` | Missing or invalid Bearer token |
| `forbidden` | Token is valid but lacks permission for this resource |
| `validation-error` | Request body or query failed validation (`errors` array has field details) |
| `idempotency-in-progress` | A prior request with the same `Idempotency-Key` is still running, retry after `Retry-After` |
| `not-found` | Wrong app, deployment, or release identifier |

Pair API errors with [server logs](#server-logs) for the full request path on the server side.

## Common update failures

### Native binary without the SDK

  <TabItem value="react-native" label="React Native">

OTA updates only work on builds that already include `@codemagic/react-native-patch`. If users still run an older store binary from before SDK integration, releases publish successfully but no client picks them up.

  </TabItem>
  <TabItem value="capacitor" label="Capacitor">

OTA updates only work on builds that already include `@codemagic/capacitor-patch`. If users still run an older store binary from before SDK integration, releases publish successfully but no client picks them up.

  </TabItem>
</SdkTabs>

Symptoms:

- Release appears in `release list` but devices never update
- No update-related activity in device logs

Fix:

  <TabItem value="react-native" label="React Native">

1. Confirm [native setup](/docs/setup/native-setup) is complete
2. Ship a new native build with the SDK and correct deployment key
3. For Staging, an internal/dev build is enough; for Production, users need the new store binary

  </TabItem>
  <TabItem value="capacitor" label="Capacitor">

1. Confirm [native setup](/docs/setup/native-setup-capacitor) is complete
2. Ship a new native build with the SDK and correct deployment key
3. For Staging, an internal/dev build is enough; for Production, users need the new store binary

  </TabItem>
</SdkTabs>

See [Core concepts. SDK prerequisite](/docs/introduction/core-concepts#prerequisite-a-native-build-with-the-sdk).

### `npx react-native spm add` reports mixed Swift and Objective-C sources

React Native's SwiftPM mode needs SDK 0.7.0 or later, the first version that ships a `Package.swift`. With an older SDK, `npx react-native spm add` stops with:

```text
error: "@codemagic/react-native-patch" has mixed Swift + Objective-C/C++ sources, which Swift Package Manager cannot compile in a single target
```

Upgrade the SDK with your package manager, then run `npx react-native spm add` again:

```bash
yarn add @codemagic/react-native-patch@^0.7.0
```

`cmpatch wire` does not do this upgrade for you. Until `spm add` succeeds, the app is still a CocoaPods project, and wire leaves an installed SDK 0.5.0 or later as it is.

Do not follow the error's suggestion to set `platforms: { ios: null }` for the SDK in `react-native.config.js`: the iOS app then builds without Patch and never applies an update. See [React Native SwiftPM mode](/docs/setup/native-setup#ios-swiftpm).

### Wrong binary version targeting

Updates only install when the device's native version matches the release's target binary version.

  <TabItem value="react-native" label="React Native">

```bash
cmpatch release-react --target-binary-version "1.2.0" ...
```

  </TabItem>
  <TabItem value="capacitor" label="Capacitor">

```bash
cmpatch-capacitor release create --bundle-path www --target-binary-version "1.2.0" ...
```

The version is not detected automatically. Pass the installed build's `CFBundleShortVersionString` / `versionName`. A release cannot be retargeted later; to target another version, publish the bundle again. See [Binary version compatibility](/docs/using-patch/binary-version-capacitor).

  </TabItem>
</SdkTabs>

If you shipped a new store build but forgot to target its version, eligible devices will not receive the OTA.

### Update downloaded but not visible yet

With default `sync()` settings, non-mandatory releases use **`ON_NEXT_RESTART`**: the SDK can download and stage a release, but the new bundle does not run until the app process is killed and opened again.

Symptoms:

- Dashboard metrics show downloads, or `sync()` returns `"update-installed"`, but the UI still shows the old JS
- QA reports "OTA doesn't work" after one launch
- Update appears only after force-quitting the app (swipe away from recents), not after backgrounding

Fix:

  <TabItem value="react-native" label="React Native">

1. **Cold-start twice** when testing: once to download, once to run the staged bundle, see [Verify a test release](/docs/using-patch/verify-test-release#3-trigger-an-update-check-on-device)
2. For production, pick an install mode that matches your UX: `ON_NEXT_RESUME`, `ON_NEXT_SUSPEND`, or prompt the user then call `restartApp()`, see [Applying updates](/docs/setup/applying-updates#install-modes)
3. Wire `sync()` on foreground return so pending updates download while the app is open:

```ts
AppState.addEventListener("change", (next) => {
  if (next === "active") void sync();
});
```

  </TabItem>
  <TabItem value="capacitor" label="Capacitor">

1. **Cold-start twice** when testing: once to download, once to run the staged bundle, see [Verify a test release](/docs/using-patch/verify-test-release#3-trigger-an-update-check-on-device)
2. For production, pick an install mode that matches your UX: `ON_NEXT_RESUME`, `ON_NEXT_SUSPEND`, or prompt the user then call `restartApp()`, see [Applying updates](/docs/setup/applying-updates#install-modes)
3. Also check when the app returns to the foreground, so updates download while the app is open:

```ts

start({ checkFrequency: CheckFrequency.ON_APP_RESUME });
```

  </TabItem>
</SdkTabs>

Mandatory releases default to **`IMMEDIATE`** and reload as soon as install finishes, so they do not wait for a restart.

### White flash when applying an update

A brief **white or blank screen** while the app is in the foreground usually means the JS bundle **reloaded in place**. That is expected with **`mandatoryInstallMode: "IMMEDIATE"`** (the default for `--mandatory` releases): Patch reloads as soon as the download finishes, which can feel like a sudden reboot mid-session.

Symptoms:

- Flash of white or the splash screen while the user is actively using the app
- Happens on mandatory releases, not when a non-mandatory release is waiting on `ON_NEXT_RESTART`

Fix:

  <TabItem value="react-native" label="React Native">

1. Reserve `--mandatory` for fixes that truly cannot wait, see [Production control](/docs/using-patch/production-control#mandatory-updates)
2. Use a gentler client mode if the update is mandatory on the server but does not need an instant reload:

```ts

void sync({
  installMode: InstallMode.ON_NEXT_RESTART,
  mandatoryInstallMode: InstallMode.ON_NEXT_RESTART, // or ON_NEXT_RESUME
});
```

3. During critical flows (checkout, video call), use `disallowRestart()` / `allowRestart()` so an immediate mandatory update waits until the flow completes, see [Applying updates](/docs/setup/applying-updates#blocking-restarts-during-critical-ux)
4. Keep your native splash screen configured so a reload shows branded loading instead of a bare white frame

  </TabItem>
  <TabItem value="capacitor" label="Capacitor">

1. Reserve `--mandatory` for fixes that truly cannot wait, see [Production control](/docs/using-patch/production-control#mandatory-updates)
2. Use a gentler client mode if the update is mandatory on the server but does not need an instant reload:

```ts

start({
  installMode: InstallMode.ON_NEXT_RESTART,
  mandatoryInstallMode: InstallMode.ON_NEXT_RESTART, // or ON_NEXT_RESUME
});
```

3. During critical flows (checkout, video call), use `disallowRestart()` / `allowRestart()` so an immediate mandatory update waits until the flow completes, see [Applying updates](/docs/setup/applying-updates#blocking-restarts-during-critical-ux)
4. Keep your native splash screen configured so a reload shows branded loading instead of a bare white frame

  </TabItem>
</SdkTabs>

### Incorrect deployment key

If the embedded deployment key (`CodemagicPatchDeploymentKey`, or `deploymentKey` for Capacitor) does not match the intended deployment, the app checks the wrong channel.

Common mistakes:

  <TabItem value="react-native" label="React Native">

- Production key in a Staging build (or vice versa)
- Same key shared across iOS and Android
- Typo in `Info.plist` / `strings.xml` / Expo plugin config

  </TabItem>
  <TabItem value="capacitor" label="Capacitor">

- Production key in a Staging build (or vice versa)
- Same key shared across iOS and Android
- Typo in `capacitor.config.ts`, or a native-resource override that does not match the intended deployment

  </TabItem>
</SdkTabs>

  <TabItem value="react-native" label="React Native">

### `cmpatch release-react` run outside the project root

The command must run from the React Native project root (where `package.json` and the bundle entry live).

  </TabItem>
  <TabItem value="capacitor" label="Capacitor">

### App shows a blank screen after an update

The bundle was published from the wrong directory level. The WebView loads the release root directly, so `index.html` must be at the top level of `--bundle-path`. Pass the `webDir` directory itself (usually `www`), or a ZIP of its contents rather than of the folder. `cmpatch-capacitor release create` checks for a top-level `index.html` before uploading. Build the web app first; the CLI does not run the build.

To validate a bundle without uploading it, run `release create --dry-run`.

  </TabItem>
</SdkTabs>

### Missing `notifyAppReady()` with manual flows

If you install updates via [manual control](/docs/setup/manual-control) without `sync()`, call `notifyAppReady()` once the new bundle boots successfully. Repeated launches without confirmation exhaust the pending bundle's launch-attempt budget (`CodemagicPatchMaxLaunchAttempts`, or `maxLaunchAttempts` in `capacitor.config.ts`; default 2) and trigger rollback. See [`notifyAppReady()`](/docs/reference/sdk-reference#notifyappready).

### CI cannot reach the server

GitHub Actions and remote CI runners cannot call `http://127.0.0.1` or `localhost` on your laptop. Set `CODEMAGIC_PATCH_SERVER_URL` to a public Patch URL. See [CI integration](/docs/using-patch/ci-integration).

## Native build fails in the build metadata step

  <TabItem value="react-native" label="React Native">

When the `Codemagic Patch build metadata` step cannot record a build that embeds its JS bundle, it fails the build instead of shipping an app without a correct record. Xcode lists its `error:` lines as build issues; Gradle prints the same lines, tagged `[codemagic-patch build-tools]`, with a code and the cause:

```text
error: [codemagic-patch build-tools] (UNSUPPORTED_BUNDLE_NAME): platform=android appRoot=/path/to/app
error: [codemagic-patch build-tools] cause: bundle name "custom.android.bundle" is not supported on android; only index.android.bundle is. Remove the custom bundleAssetName.
error: [codemagic-patch build-tools] hint: to build without this step, set CODEMAGIC_PATCH_SKIP_BUILD_FINGERPRINT=1. The app then has no CodemagicPatchBuild.json.
```

- **`ENABLE_USER_SCRIPT_SANDBOXING`**: Xcode's User Script Sandboxing keeps the phase from reading the project. Set it to `NO` for the app target.
- **`UNSUPPORTED_BUNDLE_NAME`**: only the default bundle names `main.jsbundle` and `index.android.bundle` are supported. Remove a custom `BUNDLE_NAME` (iOS) or `bundleAssetName` (Android).
- **`UNSUPPORTED_NODE`**: the build tools need Node.js 20 or newer on the build machine. On iOS this is the Node.js that `NODE_BINARY` in `ios/.xcode.env` points at.
- **`INVALID_PROJECT_CONFIG`**: the step cannot use `fingerprint.config.js`, for example because it uses `export default`, which the engine ignores (use `module.exports`), or because the config is a `.ts`, `.mjs` or `.json` file the engine never reads. The cause line says which.
- **`CALCULATOR_FAILED` mentioning autolinking**: the project's React Native or Expo autolinking command failed. Check its output and installed dependencies; Patch rejects an incomplete fingerprint instead of recording one without native dependencies.
- **`CALCULATOR_FAILED` mentioning native project sources**: the step computes the fingerprint where `cmpatch release-react` does, in the app's root directory, and expects the native project in `ios/` or `android/` there. A native project outside the React Native app's directory is not supported. On iOS the app root is the `PROJECT_ROOT` build setting when the target sets one, otherwise the parent of the Xcode project's directory; the last `error:` line says which.
- **`CALCULATOR_FAILED` mentioning the Expo config**: `app.config.js` or `app.json` could not be loaded. The line `Cannot get Expo config from an Expo project` in the build output has the cause. An Expo project with a `.env` file needs Node.js 20.12 or newer for this.

A development build served by Metro prints these causes as warnings instead and builds without `CodemagicPatchBuild.json`; a build that embeds its bundle still fails on them. The sandbox setting is the exception: it fails every build.

Yarn Plug'n'Play is not supported. To build without the record while you fix the cause, set [`CODEMAGIC_PATCH_SKIP_BUILD_FINGERPRINT=1`](/docs/using-patch/fingerprinting#opt-out) in the build's environment. The iOS phase handles this before looking for Node or the SDK, so it also works when Node cannot be found. After an SDK update, run `cmpatch wire` (Bare) or `npx expo prebuild` (Expo) again to update the phase in your project.

  </TabItem>
  <TabItem value="capacitor" label="Capacitor">

Capacitor builds do not run the build metadata step.

  </TabItem>
</SdkTabs>

## Server issues

### Server won't boot / OAuth errors

- At least one OAuth provider is configured: `GITHUB_OAUTH_CLIENT_ID` + `_SECRET` and/or `BITBUCKET_OAUTH_CLIENT_ID` + `_SECRET` and/or `GITLAB_OAUTH_CLIENT_ID` + `_SECRET`
- `OAUTH_CLI_AUTH_SECRET` (legacy name: `OAUTH_DEVICE_POLL_TOKEN_SECRET`) and `WORKER_SHARED_SECRET` are each ≥ 32 chars
- Under `REGISTRATION_MODE=invite_only`, `INITIAL_ADMIN_EMAILS` is non-empty

If sign-in rejects the OAuth app credentials, run `cmpatch selfhost install --repair` to correct them, then try again.

### First admin sign-in rejected

- `INITIAL_ADMIN_EMAILS` matches the chosen sign-in account's verified primary email
- OAuth callback URL is `https://<api-domain>/auth/callback` ([OAuth app settings](/docs/reference/cli-reference#scripted-install))

### cmpatch selfhost cannot connect over SSH

The first `cmpatch selfhost` command against a server connects with your own
SSH setup once to install its own key. When that connection fails it offers a
private key file, a retry with the SSH password, a line to paste into your
provider's web console, and a chance to correct the user or address. If none
of them connects:

- The account is wrong more often than the address: `root` on most VPS
  providers, `ubuntu` on Ubuntu cloud images, `ec2-user` on Amazon Linux,
  `admin` on Debian on AWS, `azureuser` on Azure
- Port 22 is open to your machine in the provider's firewall or security group
- A rebuilt server behind the same IP changes its host key, and `ssh` then
  refuses every connection to it. The command prints the `ssh-keygen -R`
  command that clears the old entry; run it and try again
- On Google Compute Engine with **OS Login** enabled, keys pasted into
  `authorized_keys` are ignored, so the console paste never takes effect. Turn
  OS Login off for the instance, or add the key through Google Cloud's own SSH
  keys screen
- `--ssh-key <path>` supplies the first-connection key without the prompt, and
  is the way in for a non-interactive run
- A [Fly install](/docs/install#fly) is never reached over SSH. If `upgrade`,
  `backup` or `restore` says no self-hosted server is set up and asks for
  `user@vps`, this machine has no record of the install, or another server is
  the active one: record it with
  `cmpatch selfhost install --fly --register --company "<company>"`, or select
  it with `cmpatch config set server-url https://<app>.fly.dev`

### Caddy certificate issuance is slow

- API and storage DNS point at the host; ports 80/443 are open
- With Cloudflare, keep the storage domain DNS only (grey cloud in [DNS](https://dash.cloudflare.com/?to=/:account/:zone/dns/records)) until the first certificate is issued: see [CDN settings](/docs/reference/cdn#cloudflare)
- With bundled CloudFront, keep both the viewer and origin hostnames pointed at
  the Patch host until install and the pre-cutover checks finish. Moving the
  viewer CNAME early prevents Caddy's HTTP-01 challenge; see
  [CloudFront DNS ordering](/docs/reference/cdn#bundled-silo)

### CloudFront returns 403 or 502

- `403` from the origin hostname without
  `X-Codemagic-Patch-Origin-Verify` is expected and proves bundled-origin
  protection is active
- `403` through CloudFront usually means its custom origin header differs from
  both `CLOUDFRONT_ORIGIN_VERIFY_SECRET` values; follow the
  [rotation procedure](/docs/reference/cdn#rotate-the-bundled-origin-secret)
- `502` commonly means the origin domain is wrong, its certificate is not
  valid for that hostname, or the distribution forwards the viewer `Host`
  header instead of letting CloudFront send the origin hostname
- Confirm the distribution status is **Deployed**, then run the two
  [pre-cutover commands](/docs/reference/cdn#5-verify-before-changing-dns)

### CloudFront serves stale manifests

- Request the same `meta.json` twice and inspect `x-cache`; expect Miss then Hit
- Check server logs for `delivery cache purge completed with failures`
- Confirm `CLOUDFRONT_DISTRIBUTION_ID` names the viewer distribution and its IAM
  identity has only `cloudfront:CreateInvalidation` on that distribution
- Leave `MANIFEST_CACHE_CONTROL` unset so it keeps the five-minute `s-maxage`
  that `DELIVERY_ADAPTER=cloudfront` selects, bounding the stale window when a
  purge fails

## Release published but app finds no update

  <TabItem value="react-native" label="React Native">

- `CodemagicPatchDeploymentKey` matches `cmpatch deployment list`
- App binary version matches the release's target binary version
- `CodemagicPatchDownloadBaseUrl` exactly matches the server's `PUBLIC_BASE_URL`;
  only the bundled-storage default necessarily ends with `/codemagic-patch`
- iOS and Android use separate deployment keys and apps
- On SDKs older than 0.5.2, an Android release build with resource shrinking
  can lose the `CodemagicPatch*` strings. Check with
  `aapt2 dump resources app-release.apk | grep CodemagicPatch`; for an AAB, run
  `bundletool build-apks --mode=universal` first. Upgrade the SDK, or add
  `android/app/src/main/res/raw/codemagic_patch_keep.xml` (not `keep.xml`,
  which React Native's bundle task replaces):

  ```xml
  <resources xmlns:tools="http://schemas.android.com/tools"
      tools:keep="@string/CodemagicPatch*" />
  ```

  </TabItem>
  <TabItem value="capacitor" label="Capacitor">

- `deploymentKey` (or a `CodemagicPatchDeploymentKey` override) matches `cmpatch-capacitor deployment list`
- App binary version matches the release's target binary version exactly
- `downloadBaseUrl` exactly matches the server's `PUBLIC_BASE_URL`;
  only the bundled-storage default necessarily ends with `/codemagic-patch`
- iOS and Android use separate deployment keys and apps
- The app calls `start()` or `sync()`, and was built without live reload
- On SDKs older than 0.1.2, an Android release build with resource shrinking
  can lose the `CodemagicPatch*` overrides, and the app falls back to
  `capacitor.config.ts`. Check with
  `aapt2 dump resources app-release.apk | grep CodemagicPatch`; for an AAB, run
  `bundletool build-apks --mode=universal` first. Upgrade the SDK, or add
  `android/app/src/main/res/raw/codemagic_patch_keep.xml` (not `keep.xml`):

  ```xml
  <resources xmlns:tools="http://schemas.android.com/tools"
      tools:keep="@string/CodemagicPatch*" />
  ```

  </TabItem>
</SdkTabs>

## Release stuck processing

  <TabItem value="react-native" label="React Native">

```bash
cmpatch release inspect --app MyApp-iOS --deployment Staging --label <label> --wait
docker compose --project-name codemagic-patch-selfhost --env-file .env.selfhost \
  -f docker-compose.selfhost.yml logs --tail=200 server
```

  </TabItem>
  <TabItem value="capacitor" label="Capacitor">

```bash
cmpatch-capacitor release inspect --app MyApp-iOS --deployment Staging --label <label> --wait
docker compose --project-name codemagic-patch-selfhost --env-file .env.selfhost \
  -f docker-compose.selfhost.yml logs --tail=200 server
```

  </TabItem>
</SdkTabs>

## Source maps

For Datadog, Sentry, and similar tools, see [Monitoring such as Datadog or Sentry](/docs/using-patch/analytics#monitoring-such-as-datadog-or-sentry).
