Can only update react native on emulator, not physical device

前端 未结 2 1066
星月不相逢
星月不相逢 2021-01-22 07:02

I have an app working on a local emulator that is updating live and doing all the things it should be doing.

I also have a physical device connected via USB, and deployi

相关标签:
2条回答
  • 2021-01-22 07:40

    I tried this and it solved my problem.

    react-native start --reset-cache
    

    and then

    react-native run-android
    
    0 讨论(0)
  • 2021-01-22 07:57

    You probably actually can't talk to the dev server. On an emulator a virtual network with the host PC is automatic, on a real there's no virtual network set up between it and the device. You need to actually have an open port on your desktop for it, and hit the right IP on your physical device, with the wifi network (I'm assuming they're on the same wifi network) set to allow requests to your PC.

    Or turn dev support off and include the bundle file in your app. Then you're not going to hotload code, but you have a static version ready to go without a server to talk to.

    0 讨论(0)
提交回复
热议问题