Preparing for production
Preparing for production
Use this checklist after Staging looks good and before you ship OTA to real users. Each item links to the full guide; the goal is to catch gaps before the first Production release.
1. Confirm Staging end to end
QA should have validated on a build that matches how you test: correct deployment key, reachable server URLs, and a visible JS change after update. If not, finish Verify a test release first.
2. Ship a Production native binary
Production devices need a store (or production-track) build with the Production deployment key embedded, not Staging.
- Copy the Production key from
cmpatch deployment listor the dashboard - Wire
CodemagicPatchDeploymentKey,CodemagicPatchApiUrl, andCodemagicPatchDownloadBaseUrlfor Production in Native setup - Staging OTAs never reach users on the Production key, and vice versa
See Core concepts. Deployment model.
3. Tune client sync by build
Install timing (installMode, mandatoryInstallMode, when you call sync()) is client-side only. The server does not push different sync rules per deployment.
Typical pattern:
| Build | Deployment key | Sync behavior |
|---|---|---|
| Internal / QA / debug | Staging | IMMEDIATE or frequent foreground checks for fast iteration |
| App Store / Play Production | Production | ON_NEXT_RESTART or ON_NEXT_RESUME for gentler UX |
Branch in app code using your existing build flavors (__DEV__, Xcode schemes, Gradle product flavors, Expo extra, etc.):
import { sync } from "@codemagic/react-native-patch";
void sync(
__DEV__
? { installMode: "IMMEDIATE", mandatoryInstallMode: "IMMEDIATE" }
: { installMode: "ON_NEXT_RESTART", mandatoryInstallMode: "ON_NEXT_RESUME" },
);
Also wire foreground re-checks if updates should download while the app is open. See Checking for updates.
Reserve server-side --mandatory for fixes that truly cannot wait. Immediate mandatory reloads can flash a white screen mid-session, see Troubleshooting. White flash.
4. Check delivery and URLs
Production phones must reach your Patch API and storage domains over public HTTPS, not localhost or a dev machine LAN IP.
- Confirm
CodemagicPatchDownloadBaseUrlends with/codemagic-patch - Put a CDN in front of the storage domain if you expect large install bases, see Delivery and Cloudflare setup
5. Optional: bundle signing
If your app requires signed releases, configure keys before the first Production publish. See Code signing.
6. Plan the first Production release
Do not jump straight to 100% of users:
- Publish or promote to Production
- Start with a gradual rollout (e.g. 10% → 50% → 100%)
- Watch Analytics for download and failure spikes
- Know how to roll back before you need it
Day-to-day release controls: Production control.
7. Harden the server
Before opening the dashboard to a wider team, review Security and Ongoing maintenance (backups, upgrades, health).
Related
- Releasing updates: Staging → Production workflow
- Troubleshooting: version targeting, pending restart
- Pricing: free MAU threshold and commercial rates
- FAQ: compatibility, self-hosting