我更新了操作系统12.3到13.1,Xcode 13.1到14.1,并安装了命令行工具,通过Xcode运行但不使用命令行运行的 react native 应用程序,出现以下错误

    2022-12-13 16:36:47.584 xcodebuild[3616:20381] Writing error result bundle to /var/folders/zn/6l6295m57kb3vn_8pyn8xtbr0000gn/T/ResultBundle_2022-13-12_16-36-0047.xcresult
xcodebuild: error: SDK "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk" cannot be located.
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk' (errno=No such file or directory)
xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -find simctl 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
error Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues.
Error: Command failed: xcrun simctl list --json devices
2022-12-13 16:36:47.584 xcodebuild[3616:20381] Writing error result bundle to /var/folders/zn/6l6295m57kb3vn_8pyn8xtbr0000gn/T/ResultBundle_2022-13-12_16-36-0047.xcresult
xcodebuild: error: SDK "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk" cannot be located.
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk' (errno=No such file or directory)
xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -find simctl 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH

    at checkExecSyncError (node:child_process:828:11)
    at Object.execFileSync (node:child_process:863:15)

但Reaction本机应用程序运行正常如果在运行react-native run-ios之前运行此命令export SDKROOT=$(xcrun -sdk macosx --show-sdk-path),如果我关闭终端并再次运行Reaction本机应用程序,它将再次显示相同的错误

我try 了这些步骤

sudo xcode-select --reset
sudo xcode-select --install

推荐答案

嗨,我终于发现了这个问题,我的.zshrc文件指向较旧的SDK,我删除了.zshrc文件中的SDKROOT路径,并在终端上运行了export SDKROOT=$(xcrun -sdk macosx --show-sdk-path),问题为我解决了

enter image description here

Ios相关问答推荐

如何从Windows PC在iPhone上安装Flutter 应用程序

如何在SwiftUI中将图像整合到文本标签中间?

swift|在具有自定义单元格的多个TableView中没有任何内容

在最新版本的 iOS 中,设备上的Localized.strings文件发生了什么变化?

如何结合`@dynamicMemberLookup`和`ExpressibleByStringInterpolation`来实现方法链?

创建 Flutter 项目时,如何从我的系统中删除特定的开发者身份?

查找东南亚语言(泰语、高棉语、老挝语、缅甸语)中的单词边界

如何将 -fobjc-arc-exceptions 标志正确添加到 XCode 中?

我需要二进制文件来进行 App Store 应用程序传输吗?

iOS 如何使用 Alamofire 解析 JSON 可编码数组

撤销 Apple 登录令牌以进行帐户删除过程

UIButton在iOS7中没有显示突出显示

iOS 11 navigationItem.titleView 宽度未设置

如何启用滑动以删除 TableView 中的单元格?

在 Swift 中上传带参数的图像

如何隐藏uitabbar控制器

iOS中的apk类似功能是什么?

我可以通过 UIAppearance 代理设置哪些属性?

由于 GoogleSignIn、AdMob 提交应用程序时 iOS 10 GM 发布错误应用程序try 在没有使用说明的情况下访问隐私敏感数据

/usr/bin/codedesign 失败,退出代码为 1