仅使用 react-native-cli 启动器而不更改任何应用程序代码,我已尽一切可能在物理设备上启动。
我遵循了 react-native 文档,将 IP 地址更改为我的 mac,配置了我的手机,一切。请帮忙,因为我已经花了几个小时在这上面。
react-native0.29 AppDelegate 文件似乎与 0.21 不同。这可能是问题吗?
错误截图如下: Error
最佳答案
尝试注释掉:
[[RCTBundleURLProvider sharedSettings] setDefaults];
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
并添加
jsCodeLocation = [NSURL URLWithString:@"http://ipaddressofmachine:8081/index.ios.bundle?platform=ios&dev=true"];
也尝试重启物理设备
如果使用 watchman 则清除 watchman watch-del-all
清除打包程序临时文件 rm -rf $TMPDIR/react-packager-*
退出一切并重新启动计算机
关于javascript - 无法在物理 iOS 设备 (9.3) 上启动 react-native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38257355/