无法运行项目

时间:2018-10-05 10:54:29

标签: react-native react-redux react-native-ios

我在Xcode偏好设置中也选择了位置,但是得到了相同的错误

enter image description here

xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk' (errno=No such file or directory)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH

Command failed: xcrun instruments -s
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk' (errno=No such file or directory)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH

Error: Command failed: xcrun instruments -s
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk' (errno=No such file or directory)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH

at checkExecSyncError (child_process.js:601:13)
at Object.execFileSync (child_process.js:621:13)
at Object.runIOS [as func] (/Users/ranjith/Documents/Project/Login_React/node_modules/react-native/local-cli/runIOS/runIOS.js:76:17)
at Promise.resolve.then (/Users/ranjith/Documents/Project/Login_React/node_modules/react-native/local-cli/cliEntry.js:117:22)
at <anonymous> 

enter image description here

3 个答案:

答案 0 :(得分:5)

Xcode Preferences

检查Xcode命令行工具是否已正确配置,遵循路径

  

打开Xcode>首选项>位置

     

然后设置命令行工具

答案 1 :(得分:0)

您是否已安装XCode和命令行工具?

答案 2 :(得分:0)

就我而言,Xcode更新导致iPhoneOS-12.2.sdk不再可用;而是,路径包含iPhoneOS-12.4.sdk。但是react-native run-ios抱怨找不到12.2

重新启动计算机解决了该问题。