Issue: This broke with no changes between days. Even though I have metro running npx react-native start
when I run npx react-native run-android
it starts it's own metro server and does not allow me to do "fast refresh" it basically installs the debug build of the app onto the device. I need it to fast refresh for development purposes.
Already tried the steps on issue: Unable to load script from assets index.android.bundle on windows
To test and debug my android build for a react-native project I had an emulator running in one Powershell window, would start a metro server in a second Powershell window using npx react-native start
then run the app in a third powershell window using npx react-native run-android
it would go through the build and install the app, then it would "pass" the app to the react-native metro server then that would install it to the emulator. This would allow me to make changes to the code and "fast refresh" the application in the emulator/phone and logs got outputted to the Metro Server.
Versions (executed at project root folder)
npx react-native --version
: 6.0.0
npx --version
: 7.18.1
Setup:
First Powershell window:
emulator -avd Galaxy_Nexus_Android9 -no-snapshot
Second Powershell window: Make sure abd device is running
adb devices
result
List of devices attached
emulator-5554 device
run
npx react-native start
result: Metro JS Server Start
Third Powershell Window
run: npx react-native run-android
result: Run Android
I boxed the line where it launches its own JS server instead of using the one that is open.
The app opens fine on the emulator (I initialized a new app to make sure there was nothing wrong with the app) App Running Android
But on the Metro window, it did not install the app and when I try to reload it says it cannot detect any running apps Metro Restart I've already tried the resolution here to run it on a different port with no success No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB