我通过输入xcode-select --install
来安装Xcode命令行工具;现在我想卸载它(而不是卸载Xcode)。
我尝试过
sudo /Developer/Library/uninstall-devtools --mode=all
但是我遇到了错误
sudo: /Developer/Library/uninstall-devtools: command not found
我通过输入xcode-select --install
来安装Xcode命令行工具;现在我想卸载它(而不是卸载Xcode)。
我尝试过
sudo /Developer/Library/uninstall-devtools --mode=all
但是我遇到了错误
sudo: /Developer/Library/uninstall-devtools: command not found
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --switch /Applications/Xcode.app
- DawnSong以下是一个来自苹果技术说明的节选(感谢matthias-bauch):
Xcode 包括了所有的命令行工具。如果它已经安装在你的系统上,卸载 Xcode 就会卸载掉这些工具。
如果你是从 Xcode 分开下载这些工具,那么它们将存储在你的系统中的
/Library/Developer/CommandLineTools
目录下。只需删除 CommandLineTools 文件夹即可卸载这些工具。
你可以很容易地使用终端删除它们:
这里有一篇文章,说明了如何移除命令行工具,但需要注意风险并自行承担。只有以上方法都不起作用时,请尝试此方法。
cd /Library/Developer/CommandLineTools
如果出现 No such file or directory
的提示,那么路径肯定不存在。 - Durai Amuthan.Hxcode-select --install
命令无法正常工作。 - Jason请注意:这是根目录下的 /Library,而不是用户的 ~/Library。/Library/Developer/CommandLineTools
$PATH
出了问题?当你输入which sudo
或者whereis sudo
时,输出是什么?希望它会打印出类似于/usr/bin/sudo
这样的东西。 - aug