I've added additional configurations in Xcode, for my React Native project, to manage different bundle ID's and environments. My problem is that the newly added configurations cannot connect to Metro. They install and run on the simulator just fine.
To be clear, like all React Native projects my project started off with default "Debug" and "Release" configurations. They still work. For example if I run either of the following two commands, the app will run on the simulator and connect to Metro just fine:
npx react-native run-ios
Or:
npx react-native run-ios --configuration "Debug"
Either of the above runs the app just as always (with the default, production, bundle ID I started my project with). But I added a few more configurations for the various environments: development, alpha, and QA (a dev and release for each of the three). So, for example, if I run this command, the app still runs on the simulator just fine, but will not connect to Metro:
npx react-native run-ios --configuration "Dev Debug"
My big clue is this. Take a look at this screen shot, produced when my app does connect successfully to Metro:
The BUNDLE ./index.js
line never appears when my app fails to connect to Metro. I don't know what exactly produces that line or in what script to find this, but my hunch is that the problem is right there.
Any ideas how I can get my newly added configurations to connect to Metro, just like the existing default ("Debug") configuration?
EDIT:
I have determined that the same thing happens if I run the app directly from Xcode, depending on what Build Configuration I choose in the Run setting of the Scheme:
If I select "Debug," the app attaches to Metro. Otherwise, the new configurations do not.