Flutter 错误:无法找到实用程序“xcodebuild”,不是开发人员工具或在 PATH 中

erg*_*mox 0 macos xcode dart arm64 flutter

当我重新安装 Flutter 和 Xcode 并想要为 macOS 桌面启动新创建的 Flutter 应用程序时,收到以下错误消息。

   Launching lib/main.dart on macOS in debug mode...
    lib/main.dart:1
    ProcessException: Process exited abnormally:
    xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH
      Command: /usr/bin/arch -arm64e xcrun xcodebuild -list -project Runner.xcodeproj
    Exited
Run Code Online (Sandbox Code Playgroud)

erg*_*mox 6

非常感谢马特,

\n

解决方案\xe2\x80\xa8\xe2\x80\xa8

\n

打开 Xcode 并选择要指向的版本

\n

Xcode -> 首选项 -> 位置 -> 命令行工具 -> XX.XX

\n