问题描述
我刚刚使用命令 xcode-select --install
安装了 xcode 命令行工具。
现在,每次我重新启动计算机并写入终端 swift --version
时,都会收到以下警告。
我尝试使用 xcode-select --switch ~ / Applications / Xcode.app 命令更改 xcode-select
包。它没有帮助。甚至尝试重新安装 Xcode 命令行工具。它也没有帮助。总是相同的警告。
你能告诉我怎么做才能避免收到警告吗?
计算机:Apple MacBook Pro 13" M1 (2020)
操作系统:Big Sur 11.1
解决方法
先尝试一个简单的、记录在案的步骤
解决方案可能很简单sudo xcode-select -r
这个命令在 M1 机器上为我解决了这个问题,并避免了尝试来自陌生人的随机的、未记录的想法的风险。似乎值得先尝试。
文档
% xcode-select -h
Usage: xcode-select [options]
Print or change the path to the active developer directory. This directory
controls which tools are used for the Xcode command line tools (for example,xcodebuild) as well as the BSD development commands (such as cc and make).
Options:
-h,--help print this help message and exit
[...]
-r,--reset reset to the default command line tools path