如何完全删除 Xcode 4

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5255959/
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-09 03:44:12  来源:igfitidea点击:

How to fully remove Xcode 4

xcodexcode4

提问by Jonas Anderson

I want to remove all existing SDK versions as well as Xcode 4.

我想删除所有现有的 SDK 版本以及 Xcode 4。

Xcode 4 Guide says to do this:

Xcode 4 Guide 说要这样做:

sudo /Xcode4/Library/uninstall-devtools --mode=all

But I don't have Xcode4 at this location and the only place I see it is under /Developer/Applications

但是我在这个位置没有 Xcode4,我看到它的唯一地方是 /Developer/Applications

I've already run the uninstall-devtools that was previously found in /Developer/Applicationsand then did a reinstall.

我已经运行了之前在其中找到的卸载开发工具/Developer/Applications,然后重新安装了。

What else can I do to completely remove everything and start from scratch?

我还能做些什么来完全删除所有内容并从头开始?

回答by esqew

I use this command:

我使用这个命令:

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


Edit(1 year later):

编辑(1年后):

If you've downloaded Xcode from the App Store, it's self-contained, as @mediaslave suggests. You can just drag it to the trash or use AppZapper (or a similar utility) to remove the developer tools.

如果您从 App Store 下载了 Xcode,它是独立的,正如@mediaslave 所建议的那样。您可以将它拖到垃圾箱或使用 AppZapper(或类似的实用程序)来删除开发人员工具。

If you're looking to update it, you can also do that straight through the App Store.

如果您想更新它,也可以直接通过 App Store 进行更新。

回答by Chris

sudo /[xcode-path]/Library/uninstall-devtools --mode=all

Normally, [xcode-path] means /Developer, but if you have multiple versions, for example 3 is the first installed, 4 is second, /Developer will be xcode 3's root derectory and /Xcode4 for xcode 4.

通常,[xcode-path] 表示 /Developer,但如果您有多个版本,例如 3 是第一个安装,4 是第二个,/Developer 将是 xcode 3 的根目录,而 /Xcode4 将是 xcode 4。

回答by occulus

Ensure Xcode, iOS Simulator, and the Mac App Store apps aren't running, then trying running the uninstall script at this (different!) location:

确保 Xcode、iOS Simulator 和 Mac App Store 应用程序未运行,然后尝试在此(不同!)位置运行卸载脚本:

/Library/Developer/Shared/uninstall-devtools

This is where I found it.

这是我找到它的地方。

Also delete Install Xcode.appfrom Applications folder, and Empty Trash.

同时Install Xcode.app从应用程序文件夹和清空垃圾箱中删除。

Then run App Store again, and find/install Xcode.

然后再次运行 App Store,并找到/安装 Xcode。

回答by m4f1050

su(or sudo su, whatever)

su(或者sudo su,随便)

find / -name uninstall-devtools

This will reveal where the utility is...

这将揭示实用程序在哪里......

回答by DenTheMan

If you have XCode 4.3.1, just Move To Trash the XCode.appfile in the Applicationsfolder.

如果您有 XCode 4.3.1,只需将应用程序文件夹中的XCode.app文件移至垃圾箱即可

回答by suresh

If you have installed xcode from Mac App store, then you need to delete it from Launch pad. You can do this by locating xcode icon in launch pad, long click on the icon till it starts dancing. Then delete it and wait for a while till the xcode.app is deleted from /Application. If you manually delete xcode.app from /Application, App store will continue to think its installed and will not allow you to reinstall in future.

如果你已经从 Mac App Store 安装了 xcode,那么你需要从 Launch pad 中删除它。您可以通过在启动板中找到 xcode 图标来完成此操作,长按该图标直到它开始跳舞。然后删除它并等待一段时间,直到 xcode.app 从 /Application 中删除。如果您手动从 /Application 中删除 xcode.app,App store 将继续认为它已安装并且不允许您以后重新安装。

回答by Huckphin

I tried to uninstall this by deleting it, but the AppStore still thought that it was installed. I deleted some preferences files in my /private directory, which made the AppStore "forget" that I had installed Xcode. I used the following command:

我试图通过删除它来卸载它,但AppStore仍然认为它已安装。我删除了 /private 目录中的一些首选项文件,这让 AppStore“忘记”我已经安装了 Xcode。我使用了以下命令:

sudo find / -iname '*xcode*' 2> /dev/null | egrep '^/private.*' | xargs -I file sudo rm -rfv file

Which deleted the following files from my computer:

从我的电脑中删除了以下文件:

/private/var/db/receipts/com.apple.pkg.XcodeMAS_iOSSDK_6_1.bom
/private/var/db/receipts/com.apple.pkg.XcodeMAS_iOSSDK_6_1.plist
/private/var/folders/7d/n34963zx62s7znxyzn3dn6bh0000gq/C/com.apple.Xcode.503/CachedSpecifications-Xcode
/private/var/folders/7d/n34963zx62s7znxyzn3dn6bh0000gq/C/com.apple.Xcode.503/CachedSpecifications-xcodebuild
/private/var/folders/7d/n34963zx62s7znxyzn3dn6bh0000gq/C/com.apple.Xcode.503

I do not know what these files are used for, but it made the AppStore forget that it was installed, which is what I needed to happen. In my case, the AppStore was not allowing me to update to the new version of Xcode.

我不知道这些文件是做什么用的,但它让 AppStore 忘记了它已安装,这正是我需要发生的。就我而言,AppStore 不允许我更新到新版本的 Xcode。