The official React Native documentation to run app on iOS device using offline bundle says
Open ios/YourApp/AppDelegate.m
Uncomment the line, jsCo
When I open the global proxy in ShadowsocksX, automatic IP detection won't return http://localhost:8081/index.ios.bundle in the debug mode.
That's why the URL for main.jsbundle returned as null.
How to solve?
Option 1:
replace
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
with
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
This method could disable automatic IP detection.
Option 2:
Switch your proxy mode if you open the global proxy mode.