Added ability to specify an alternative port for the run-android command #13825
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… to allow simultaneous iOS / Android hot reload connections via separate packager instances.
Motivation (required)
When attempting to use Hot Reloading on an iOS and Android device at the same time (with the packager instance), it switches between them as you interact with the devices rather than working with both. To resolve this, each device needs to be pointed to a separate packager instance. The current hardcoding of port 8081 makes this difficult. This pull request introduces a new "--port" option for the run-android command.
Test Plan (required)
I need help here. From what I can tell, my change is sane and is correctly propagating the port to every level. I'm doing an adb reverse from 8081 to the specified port in order to allow the hardcoded 8081 in the native device constants to continue working.
However, I think I have something misconfigured in my environment for building React Native for Android as I am getting a javascript error in my app on master even prior to my change, and it's also looking for the bundle in the wrong location. I don't know if I'm just experiencing a problem introduced on master, or if it's me. 🤷♂️
Next Steps
I've signed the CLA, and I'm hoping someone can help review this change or guide me in what I've screwed up in my build environment.