
After migrating to AppsOnAir CodePush, you might notice that only a Production deployment is generated by default.
Unlike App Center, which automatically creates both Staging and Production deployments, AppsOnAir simplifies the process by allowing you to configure your environments manually.
The Best Approach: Separate Apps for Staging & Production
AppsOnAir CodePush associates deployments with specific apps. To manage multiple environments effectively, follow these steps:
Step 1: Create a Staging App
Log in to the AppsOnAir Portal and create a new app. Name it something like “MyApp-Staging” to designate it as your staging environment.
Step 2: Retain Your Production App
Your existing app (e.g., MyApp) remains your Production version, where only stable updates are deployed.
Step 3: Configure Deployment Keys in Your Code
Now, in your app's code, use different deployment keys for each environment, such as staging and production.
Environment Variables
Define the deployment keys in an .env
file or configuration file:
App Configuration (React Native)
Modify your app’s initialization to dynamically load the appropriate deployment key:
- Debug builds will use the Staging environment.
- Release builds will use the Production environment.
Step 4: Deploy Updates to the Correct Environment
Ensure that updates are released to the right deployment:
Deploy to Staging
Define the deployment keys in an .env
file or configuration file:
Deploy to Production
Why This Approach is Recommended
- Prevents accidental releases – Test updates safely in a dedicated Staging environment.
- Maintains clear separation – Staging and Production builds remain independent.
- Scalability – Easily add additional environments like Beta or QA as needed.
By structuring your environments this way, you ensure a smooth update process and minimize risks when deploying changes.
Start managing your deployments efficiently with AppsOnAir CodePush today! 🚀