简体   繁体   English

React Native:没有日志出现在 Xcode 和 react-native run-ios 中会抛出奇怪的错误

[英]React Native: No logs showing up in Xcode and react-native run-ios throws weird error

While running a React Native App on a real iOS device, Xcode doesn't show any logs in the window it's supposed to print all of them.在真正的 iOS 设备上运行 React Native App 时, Xcode不会在 window 中显示任何日志,它应该打印所有日志。 It's just empty.它只是空的。

Additionally, react-native-run-ios does not start and instead throws this error:此外, react-native-run-ios不会启动,而是会引发此错误:

error Cannot read property 'udid' of null.
  • The app builds fine and runs on the device.该应用程序构建良好并在设备上运行。 Reloading the app via the shake menu doesn't help.通过摇动菜单重新加载应用程序无济于事。
  • React Native version is 0.59.9 React Native 版本是0.59.9

Disconnecting and reconnecting the device's cable to the computer and building again makes the logs appear.将设备的电缆断开并重新连接到计算机并再次构建会显示日志。

react-native run-ios now now throws the expected error: react-native run-ios现在抛出预期的错误:

error Could not find iPhone X simulator.

(or whichever simulator is your default). (或您的默认模拟器)。

I originally started XCode while the phone was already connected.我最初在手机已连接时启动XCode So perhaps it's best to connect your phone to the computer when XCode is already open.因此,也许最好在XCode已经打开时将手机连接到计算机。

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

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