I want to try running my react native app locally but against my staging and/or production server. I'm looking to do this by setting a release-channel
variable when I run expo start
. I hope this can test/foreshadow some performance in beta and production.
I tried the command expo start --release-channel staging
and I got an error error: unknown option '--release-channel'
How can I set Constants.manifest.releaseChannel
when I run expo start?
You simply need to create another channel, let's say expo publish --release-channel staging and build a new binary that will subscribe to this specific staging channel (you can upload this build on Testflight for example and each time you will publish new changes on this channel, your Testflight users will be able to ...
If you are given a project that needs rapid development, and you have picked React Native to build the cross-platform app, Expo is the best fit for you. With Expo, you can build and deploy React Native apps for both iOS and Android with ease. With Expo, you will never touch any native iOS or native Android code.
Release channels offer customers the ability to balance between stability and the feature set of the version deployed in the cluster.
Running your React Native applicationInstall the Expo Go app on your iOS or Android phone and connect to the same wireless network as your computer. On Android, use the Expo Go app to scan the QR code from your terminal to open your project. On iOS, use the built-in QR code scanner of the default iOS Camera app.
Environment variables don't exist explicitly, but you can utilize release channels to make that happen! Say you have a workflow of releasing builds like this:
expo publish --release-channel staging-v1
For standalone apps:
Build your standalone app by running
expo build:ios --release-channel <your-channel>
expo build:android --release-channel <your-channel>
You can access the channel your release is published under with the releaseChannel field in the manifest object. Constants.manifest.releaseChannel does NOT exist in dev mode. It does exist, however when you explicitly publish / build with it.
Here is a detailed description of this answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With