我正在尝试从命令行更新Xcode。一开始我试着跑步:
xcode-select --install
这就产生了这条信息:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
那么问题来了,有没有办法从命令行更新Xcode呢?
我正在尝试从命令行更新Xcode。一开始我试着跑步:
xcode-select --install
这就产生了这条信息:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
那么问题来了,有没有办法从命令行更新Xcode呢?
当前回答
只要输入命令
cd /Library/Developer/CommandLineTools/Packages/;
open macOS_SDK_headers_for_macOS_10.14.pkg
参考:https://forums.developer.apple.com/thread/104296
其他回答
对于那些在更新到卡特琳娜后有此问题的人,只需在您的终端上执行此命令
sudo rm -rf /Library/Developer/CommandLineTools; xcode-select --install;
只要输入命令
cd /Library/Developer/CommandLineTools/Packages/;
open macOS_SDK_headers_for_macOS_10.14.pkg
参考:https://forums.developer.apple.com/thread/104296
我遇到了同样的问题,使用下面的命令解决了它。
sudo xcode-select -s /Library/Developer/CommandLineTools
运行上述命令后,xcode-select -p命令显示如下内容。
/图书馆/开发/ CommandLineTools
当我卸载完整版本的Xcode以重新安装CLI版本时,我遇到了同样的问题。我的解决方案是:
sudo xcode-select -s /Library/Developer/CommandLineTools
在安装命令行工具(使用xcode-select——install)后,输入:
sudo xcode-select --switch /Library/Developer/CommandLineTools/
你现在应该可以运行git了:
10:29 $ git --version
git version 2.17.2 (Apple Git-113)