metro icon indicating copy to clipboard operation
metro copied to clipboard

[Question] Different port behavior between npx react-native start and run-android

Open EzioLi01 opened this issue 2 years ago • 1 comments

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:

  1. Create new rn template.
  2. Execute npx react-native run-android --port 9999, after metro and application starting, check http://localhost:9999/json/list, it can get debugger websocket info.
  3. In new app project, execute npx react-native start --port 9999 and a to open android application. After metro and application starting, check http://localhost:9999/json/list, no debugger websocket info here, but it displayed in http://localhost:8081/json/list.
  4. The behavior of run-android and start + a to run on Android are not identical

EzioLi01 avatar Jul 27 '23 12:07 EzioLi01

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

onmotion avatar Mar 06 '24 19:03 onmotion