Description
Description
As a long-time React Native developer (7 years professionally), I’ve noticed a quality-of-life improvement that could greatly enhance the Android developer experience. Currently, when building for iOS, the IP address of the computer where the Metro Bundler is running gets bundled into the app automatically. This ensures the app can always find the bundler, even when disconnected from USB.
On Android, however, this process isn’t as smooth. If the USB cable gets disconnected (intentionally or accidentally), developers must manually shake the device to open the dev menu and enter the IP address. This process is tedious and error-prone, especially for newcomers who may not fully understand how the bundler communicates with the device. Often, they resort to rerunning yarn android or similar commands unnecessarily.
Proposal
I propose that Android should adopt the same behavior as iOS by bundling the local computer’s IP address into the app during the build process. Here’s how it could work:
When connected via USB, the app uses the localhost address through adb reverse (the current behavior).
If USB is disconnected, the app seamlessly falls back to the bundled IP address to communicate with the Metro Bundler over Wi-Fi.
Discussion points
I’d love to hear thoughts from the community and the React Native team on this idea. Are there potential challenges I might have overlooked? Would this align with the project’s goals and vision?
If the idea seems viable, I’m also open to contributing a pull request to implement this feature, with some guidance from the maintainers.
Thank you for considering this request!