方法一
// 项目在模拟器运行状态执行如下代码:
npm install
react-native run-ios
方法二
// 修改AppDelegate.m代码:
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
改为
jsCodeLocation = [NSURL URLWithString:@"http://127.0.0.1:8081/index.ios.bundle?platform=ios&;dev=true"];
方法三
修改代理shadowsocks VPN, 调整自动代理
方法四: 配置host
在/etc/hosts文件中添加127.0.0.1 localhost
即可