方法一
// 項目在模拟器運作狀态執行如下代碼:
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
即可