React Native using pre-bundled file on device, even if DEV-mode

前端 未结 7 984
南笙
南笙 2020-12-30 20:05

A few days ago, when I build and run my react native app from Xcode on a device, I realised that even if I set my scheme to Debug, the app is still loading from a pre-bundle

7条回答
  •  渐次进展
    2020-12-30 20:24

    so your problem is here:

    Change code in your AppDelegate.m:

    jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; // comment this line
    
    jsCodeLocation = [NSURL URLWithString:@"http://xxx.xxx.x.xx:8081/index.ios.bundle?platform=ios&dev=true"]; //uncomment this line  
    

    Cheers:)

提交回复
热议问题