metro
metro copied to clipboard
[Question] Different port behavior between npx react-native start and run-android
Hey experts,
I have a question related to Metro packager port. Could you please see it and let me know if it's the expected behavior? Thank you!
Repro steps:
- Create new rn template.
- Execute
npx react-native run-android --port 9999, after metro and application starting, checkhttp://localhost:9999/json/list, it can get debugger websocket info. - In new app project, execute
npx react-native start --port 9999andato open android application. After metro and application starting, checkhttp://localhost:9999/json/list, no debugger websocket info here, but it displayed inhttp://localhost:8081/json/list. - The behavior of
run-androidandstart + ato run on Android are not identical
the same for ios, it forcibly tries to start dev server on port 8081
https://github.com/facebook/metro/assets/12899080/7e0abd38-a6da-4329-a56e-cf3838254d8a