无法运行项目

问题描述 投票:2回答:3

我也在Xcode首选项中选择了Location,但得到了同样的错误。

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

react-native react-redux react-native-ios
3个回答
7
投票

Xcode Preferences

检查Xcode命令行工具是否已配置好 正确地走以下路径

打开Xcode > Preferences > Locations。

然后设置命令行工具


3
投票

在我的例子中,Xcode更新导致iPhoneOS-12.2.sdk不再可用,取而代之的是包含iPhoneOS-12.4.sdk的路径。但是,在我的案例中,Xcode更新导致iPhoneOS-12.2.sdk不再可用;相反,路径中包含了iPhoneOS-12.4.sdk。react-native run-ios 抱怨找不到 12.2.

重新启动电脑,问题就解决了。


1
投票

你是否安装了XCode和命令行工具?

© www.soinside.com 2019 - 2024. All rights reserved.