如何卸载 Xcode 4.4 命令行工具 (Mac OS X 10.8 Mountain Lion)?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11678882/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:02:27  来源:igfitidea点击:

How to uninstall Xcode 4.4 command line tools (Mac OS X 10.8 Mountain Lion)?

xcodemacosuninstallosx-mountain-lionxcode4.4

提问by user456584

This SO postexplains very well how to install command line tools for Xcode 4.4.

这篇 SO 帖子很好地解释了如何为 Xcode 4.4 安装命令行工具。

But how to uninstallthem?

但是如何卸载它们呢?

回答by creativecoder

There's a script listed on this page to do just that on Mountain Lion: http://www.cocoanetics.com/2012/07/you-dont-need-the-xcode-command-line-tools/

此页面上列出了一个脚本,可以在 Mountain Lion 上执行此操作:http: //www.cocoanetics.com/2012/07/you-dont-need-the-xcode-command-line-tools/

Copy the script into a text file.
Save it as remove_CLI_tools.sh
Open terminal and navigate to the folder where you saved the script.
Type: sh remove_CLI_tools.sh

将脚本复制到文本文件中。
将其另存为remove_CLI_tools.sh
Open terminal 并导航到您保存脚本的文件夹。
类型:sh remove_CLI_tools.sh

I installed just the isolated command line tools (stand alone installer) without installing the Xcode application. So I ended up running the script twice, changing the variables at the top for each of the packages installed by the installer
(you can check which packages were installed by looking in the hidden "Packages" file of the .dmg image of the installer):
com.apple.pkg.DeveloperToolsCLI.bom and .plistcom.apple.pkg.DevSDK.bom and .plist

我只安装了独立的命令行工具(独立安装程序),而没有安装 Xcode 应用程序。所以我最终运行了两次脚本,为安装程序安装的每个包更改顶部的变量
(您可以通过查看安装程序的 .dmg 图像的隐藏“包”文件来检查安装了哪些包) :
com.apple.pkg.DeveloperToolsCLI.bom and .plistcom.apple.pkg.DevSDK.bom and .plist

Be careful (have a backup, like the post recommends).

小心(有一个备份,就像帖子推荐的那样)。

回答by ytf3333

sudo /Developer/Library/uninstall-devtools –mode=all works for 10.8.5

sudo /Developer/Library/uninstall-devtools –mode=all 适用于 10.8.5

回答by padapa

This should still work to remove xcode.

这应该仍然可以删除 xcode。

sudo /Developer/Library/uninstall-devtools –mode=all

回答by Mina Almasry

sudo /Library/Developer/Shared/uninstall-devtools --mode=all

sudo /Library/Developer/Shared/uninstall-devtools --mode=all