Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run expo start with release-channels

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?

like image 816
Adam LaMorre Avatar asked Apr 02 '19 13:04

Adam LaMorre


People also ask

How do you use Expo release channels?

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 ...

Can you use Expo for production?

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.

What are release channels?

Release channels offer customers the ability to balance between stability and the feature set of the version deployed in the cluster.

How do you run a project Expo?

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.


1 Answers

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.

like image 108
hong developer Avatar answered Nov 15 '22 08:11

hong developer