简体   繁体   English

在物理iOS设备上无法启动react-native(9.3)

[英]Trouble launching react-native on physical iOS device (9.3)

Only using the react-native-cli starter without changing any app code, I've done everything possible to launch on physical device. 仅使用react-native-cli启动程序,而不更改任何应用程序代码,我已完成了在物理设备上启动的所有可能。

I've followed the react-native docs, changed the IP address to my mac's, provisioned my phone, everything. 我已经关注了本机文档,将IP地址更改为Mac的IP地址,配置了手机,以及所有内容。 Please help, as I've spent hours on this. 请帮忙,因为我已经花了数小时。

It seems the react-native0.29 AppDelegate file is different than 0.21. 似乎react-native0.29 AppDelegate文件不同于0.21。 Could this be problem? 这可能是问题吗?

Here's the error screenshot: Error 错误截图如下: 错误

Try commenting out: 尝试注释掉:

[[RCTBundleURLProvider sharedSettings] setDefaults];
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

and add 并添加

jsCodeLocation = [NSURL URLWithString:@"http://ipaddressofmachine:8081/index.ios.bundle?platform=ios&dev=true"];

Also try restarting the physical device 同时尝试重新启动物理设备

Clearing watchman if using it watchman watch-del-all 如果使用它清除巡夜watchman watch-del-all

Clear packager temp rm -rf $TMPDIR/react-packager-* 清除打包程序temp rm -rf $TMPDIR/react-packager-*

Quit everything and restart your computer 退出所有内容并重新启动计算机

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM