After upgrade livereload missing on real device, cannot debug js remotely from real device

前端 未结 2 1137
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 12:49

After updating react native from 0.26 to 0.29, live reload and hot code push items are missing in dev menu, so I have to manually reload the app every time. However, it\'s w

相关标签:
2条回答
  • 2020-12-09 13:15

    Figured out the needed configuration for make live reload work:

    jsCodeLocation = [NSURL URLWithString: @"http://192.168.0.200:8081/index.ios.bundle?platform=ios&dev=true"];
    

    note also that without "?platform=ios&dev=true" Hot Reload didn't work for me ("Unbalanced calls start/end" errors).

    and in RCTWebSocketExecutor.m:

    host = @"http://192.168.0.200";
    

    192.168.0.200 - address of your computer. Both computer and device have to be in the same network. After that "Live Reload" item in "shake" dev menu appeared and also i started to see logs in server console:

    and also "gotta be on the same wifi network" as @jmancherje mentioned

    0 讨论(0)
  • 2020-12-09 13:15

    I think your jsbundle is not loading with real device, you have to use this for your live build when you archive build and install it.

    jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
    

    and use following line for installing from xcode

    jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
    

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