ios - 无法在 IOS 模拟器上运行 React Native 项目

标签 ios react-native

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 simctllist devices 来检查可用设备。

关于ios - 无法在 IOS 模拟器上运行 React Native 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56784072/

相关文章:

javascript - React Native 交错渲染

ios - 应用程序进入后台中断的 UIView 动画的状态是什么?

php - 带有 cURL 的 Apple 推送通知

reactjs - 如何处理在 React Native 中动态创建的多个 textInput 状态

android - 使用 React-Native-Router-Flux 在 React Native 中嵌套场景

ios - 将 TTF 字体文件编码/序列化为 NSData

ios - 如何访问 UITabBarBackgroundView

react-native - goBack 总是在 react 导航中回到主页/第一个屏幕

android - firebase云消息没有看到小米设备

javascript - 从 'react' 导入 * 作为 React; vs 从 'react' 导入 React;