I would like to run tests on two different builds of iOS, therefore I need the metro bundler to run on two different ports. But it's about the same repo, so I can't change all the occurrences of 8081. Also, I can't change manually the port using devtools in iOS Simulator, because it's for e2e tests with Detox, automatics.
I saw here and there that the use of RCT_METRO_PORT could work, but until now I don't success...
So here is the simple question: how do we make use of RCT_METRO_PORT so that the metro bundler runs on another port than 8081, using either a .env
file or an env variable in package.json
scripts?
[EDIT]: my question is not only for react native run ios
but also for building release, like this script set -o pipefail && xcodebuild -workspace ios/myapp.xcworkspace -configuration Debug -scheme myapp -destination name="iPhone 12 Pro" -derivedDataPath ios/build > /dev/null