enter image description here我是 React Native 的新手,我正在关注 React Native 官方网站来初始化一个新项目,尝试运行 IOS。但是,失败并出现以下错误。 React-Native 版本 0.59 XCode 10.2
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening HelloWorld.xcodeproj
当我运行react-native run-ios --simulator="iPhone 7"时 错误如下:
info Command PhaseScriptExecution failed with a nonzero exit code
info
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening HelloWorld.xcodeproj
最佳答案
启动模拟器:初始化React Native项目后,您可以在新创建的项目目录中运行react-native run-ios。如果一切设置正确,您很快就会看到新应用程序在 iOS 模拟器中运行。
指定设备:您可以使用 --simulator
标志指定模拟器应运行的设备,后跟字符串形式的设备名称。默认为“iPhone X”
。如果您希望在 iPhone 4s 上运行您的应用,只需运行 react-native run-ios --simulator="iPhone 4s"
。
设备名称对应于 Xcode 中可用的设备列表。您可以通过从控制台运行 xcrun simctl
list devices 来检查可用设备。
关于ios - 无法在 IOS 模拟器上运行 React Native 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56784072/