Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable metro bundler "auto pop-up"

When building react native apps metro bundler automatically pops up on new terminal window (if it is not running already).

Problem When configuring CI tool (Jenkins), for beta and release deployments, this behavior is blocking, because we want to setup 2-3 different applications and if one instance of Metro Bundler was opened before, other application build with fail.

I've checked all "Run Script" phases on XCode project. There isn't any script which opens Metro Bundler.

Does we really need metro bundler server if configurations is not debug? If no, then how to disable it on during release builds.

Thanks.

like image 995
Rafael Hovsepyan Avatar asked Jan 25 '19 14:01

Rafael Hovsepyan


2 Answers

Looking at the Start Packager step in the build process, it looks like you can set RCT_NO_LAUNCH_PACKAGER to a non-empty value to disable the packager. This worked for me running a release build using react native 0.61.5.

like image 164
NemesisRidiculii Avatar answered Nov 17 '22 10:11

NemesisRidiculii


I followed this https://reactnative.dev/docs/publishing-to-app-store and it solved the issue for me.

To configure your app to be built using the Release scheme, go to Product → Scheme → Edit Scheme. Select the Run tab in the sidebar, then set the Build Configuration dropdown to Release.

like image 37
Naren Avatar answered Nov 17 '22 09:11

Naren