ios 如何完全卸载 Xcode 并清除所有设置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31011062/
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
How to Completely Uninstall Xcode and Clear All Settings
提问by robestrong
I have an issue that I can only assume is with Xcode, where my apps take forever to run and crash the phone/restart about 75% of the time. I tried using older versions of the code that I'd saved instead, but they had the same effect, which they didn't use to have about a month ago.
我有一个问题,我只能假设是 Xcode,我的应用程序需要永远运行和崩溃电话/重新启动大约 75% 的时间。我尝试使用我保存的旧版本代码,但它们具有相同的效果,大约一个月前它们没有使用过。
I've looked up every single possible way to solve this issue for the past few weeks have haven't found anything, so I want to completely uninstall Xcode and clear all settings; but I can't find a way to do this. I can uninstall it, but when I reinstall it, it still has all of my old settings and lists of projects etc. How can I completely uninstall it?
在过去的几周里,我已经查找了解决这个问题的所有可能的方法,但没有找到任何东西,所以我想完全卸载 Xcode 并清除所有设置;但我找不到办法做到这一点。我可以卸载它,但是当我重新安装它时,它仍然具有我所有的旧设置和项目列表等。我如何才能完全卸载它?
回答by kpod13
For complete removal old Xcode 7 you should remove
要完全删除旧的 Xcode 7,您应该删除
/Applications/Xcode.app
/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/Caches/com.apple.dt.Xcode
~/Library/Application Support/Xcode
~/Library/Developer/Xcode
~/Library/Developer/CoreSimulator
/Applications/Xcode.app
/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/Caches/com.apple.dt.Xcode
~/Library/Application Support/Xcode
~/Library/Developer/Xcode
~/Library/Developer/CoreSimulator
回答by Joyce Babu
Open
Storage Management
- Go to ? > About This Mac > Window > Storage Management
- Or, hit ? + Spaceto open Spotlightand search for
Storage Management
.
Select
Applications
on left pane.- Right click on
Xcode
on the right pane and select delete.
打开
Storage Management
- 去 ?> 关于本机 > 窗口 > 存储管理
- 或者,点击? + Space打开Spotlight并搜索
Storage Management
.
Applications
在左侧窗格中选择。- 右键单击
Xcode
右侧窗格并选择删除。
This will remove XCode from the installed applications list of your Mac's App Store.
这将从 Mac App Store 的已安装应用程序列表中删除 XCode。
Update: This worked for me on macOS Sierra 10.12.1
.
更新:这在 macOS Sierra 上对我有用10.12.1
。
回答by William Cerniuk
For a completeremoval of Xcode 10delete the following:
要完全删除Xcode 10,请删除以下内容:
/Applications/Xcode.app
~/Library/Caches/com.apple.dt.Xcode
~/Library/Developer
~/Library/MobileDevice
~/Library/Preferences/com.apple.dt.Xcode.plist
/Library/Preferences/com.apple.dt.Xcode.plist
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.bom
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.plist
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.bom
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.plist
/private/var/db/receipts/com.apple.pkg.Xcode.bom
/Applications/Xcode.app
~/Library/Caches/com.apple.dt.Xcode
~/Library/Developer
~/Library/MobileDevice
~/Library/Preferences/com.apple.dt.Xcode.plist
/Library/Preferences/com.apple.dt.Xcode.plist
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.bom
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.plist
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.bom
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.plist
/private/var/db/receipts/com.apple.pkg.Xcode.bom
But instead of 11, open up /private/var/
in the Finder and search for "Xcode" to see all the 'dna' left behind... and selectively clean that out too. I would post the pathnames but they will include randomized folder names which will not be the same from my Mac to yours.
但是不是 11,而是/private/var/
在 Finder 中打开并搜索“Xcode”以查看所有留下的“dna”……并有选择地将其清除。我会发布路径名,但它们将包括随机文件夹名称,这些名称从我的 Mac 到您的都不同。
but if you don't want to lose all of your customizations, consider saving these files or folders before deleting anything:
但如果您不想丢失所有自定义设置,请考虑在删除任何内容之前保存这些文件或文件夹:
~/Library/Developer/Xcode/UserData/CodeSnippets
~/Library/Developer/Xcode/UserData/FontAndColorThemes
~/Library/Developer/Xcode/UserData/KeyBindings
~/Library/Developer/Xcode/Templates
~/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/MobileDevice/Provisioning Profiles
~/Library/Developer/Xcode/UserData/CodeSnippets
~/Library/Developer/Xcode/UserData/FontAndColorThemes
~/Library/Developer/Xcode/UserData/KeyBindings
~/Library/Developer/Xcode/Templates
~/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/MobileDevice/Provisioning Profiles
回答by matt
Before taking such drastic measures, quit Xcode and follow all the instructions here for cleaning out the caches:
在采取如此严厉的措施之前,请退出 Xcode 并按照此处的所有说明清除缓存:
How to Empty Caches and Clean All Targets Xcode 4
If that doesn't help, and you decide you really need a clean installation of Xcode, then, in addition to all of the stuff in that answer, trash the Xcode app itself, plus trash your ~/Library/Developer
folder and your ~/Library/Preferences/com.apple.dt.Xcode.plist
file. I think that should just about do it.
如果这没有帮助,并且您决定确实需要全新安装 Xcode,那么除了该答案中的所有内容之外,还可以删除 Xcode 应用程序本身,并删除您的~/Library/Developer
文件夹和~/Library/Preferences/com.apple.dt.Xcode.plist
文件。我认为这应该只是这样做。
回答by ykonda
This answer should be more of a comment against Dawn Song's comment earlier, but since I don't have enough reputation, I'm going to write it as an answer.
这个答案应该更像是对早先Dawn Song的评论的评论,但由于我没有足够的声誉,所以我将其写为答案。
According to the forum page
根据论坛页面
https://forums.developer.apple.com/thread/11313
https://forums.developer.apple.com/thread/11313
"In general, you should never just delete the CoreSimulator/Devices directory yourself. If you really absolutely must, you need to make sure that the service is not runnign while you do that. eg:"
“一般来说,你永远不应该自己删除 CoreSimulator/Devices 目录。如果你真的必须这样做,你需要确保在你这样做时服务没有运行。例如:”
# Quit Xcode.app, Simulator.app, etc
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService
rm -rf ~/Library/*/CoreSimulator
I definitely ran into this issue after deleting and reinstalling Xcode.
删除并重新安装Xcode后,我肯定遇到了这个问题。
You might encounter a problem trying to connect the build to a simulator device. The thread also answers what to do in that case,
您在尝试将构建连接到模拟器设备时可能会遇到问题。该线程还回答了在这种情况下该怎么做,
gem install snapshot
fastlane snapshot reset_simulators
回答by mding5692
FOR UNINSTALLING AND THEN BEING ABLE TO REINSTALL XCODE 9 CORRECTLY
用于卸载然后能够正确重新安装 Xcode 9
I followed the topmost answer for deleting Xcode 7 and found a major error, deleting ~/Library/Developer
will delete an important folder called PrivateFrameworks
, which will actually crash Xcode everytime you reinstall and force you to have to get your friends to send you the PrivateFrameworks folder again, a complete waste of time seeing if you needed to uninstall and reinstall Xcode urgently for immediate work purposes.
我按照删除Xcode 7的最高答案发现了一个重大错误,删除~/Library/Developer
将删除一个名为 的重要文件夹PrivateFrameworks
,实际上每次重新安装时都会使Xcode崩溃并迫使您不得不让您的朋友再次向您发送PrivateFrameworks文件夹,一个完整的浪费时间查看是否需要紧急卸载和重新安装 Xcode 以立即工作。
I have tried editing the topmost answer but see no changes so below is the modified steps you should take for Xcode 9:
我已经尝试编辑最上面的答案,但没有看到任何变化,所以下面是您应该为 Xcode 9 采取的修改步骤:
Delete
删除
/Applications/Xcode.app
/Applications/Xcode.app
~/Library/Preferences/com.apple.dt.*
(Generally anything with com.apple.dt. as prefix is removable in the Preferences folder)
~/Library/Preferences/com.apple.dt.*
(通常任何带有 com.apple.dt. 作为前缀的东西都可以在 Preferences 文件夹中移除)
~/Library/Caches/com.apple.dt.Xcode
~/Library/Caches/com.apple.dt.Xcode
~/Library/Application Support/Xcode
~/Library/Application Support/Xcode
Everything in
/Library/Developer
directory except for
/Library/Developer/PrivateFrameworks
/Library/Developer
目录中的所有内容,
除了
/Library/Developer/PrivateFrameworks
回答by user8213114
Run this to find all instances of Xcode in your filesystem:
运行此命令以查找文件系统中的所有 Xcode 实例:
for i in find / -name Xcode -print
; do echo $i; done
因为我在find / -name Xcode -print
;做回声 $i; 完毕