MacOS Xcode CoreSimulator 文件夹非常大。可以删除内容吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33419301/
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
MacOS Xcode CoreSimulator folder very big. Is it ok to delete content?
提问by Franck
My ~/Library/Developer/CoreSimulator/Devices
folder is 26 Gb
in size.
我的~/Library/Developer/CoreSimulator/Devices
文件夹26 Gb
大小。
Is it safe to just delete all the content? Will those files be automatically regenerated?
删除所有内容是否安全?这些文件会自动重新生成吗?
回答by Petr Syrov
Try to run xcrun simctl delete unavailable
in your terminal.
尝试xcrun simctl delete unavailable
在您的终端中运行。
Original answer: Xcode - free to clear devices folder?
原始答案:Xcode - 免费清除设备文件夹?
回答by MacMark
That directory is part of your user data and you can delete any user data without affecting Xcode seriously. You can delete the whole CoreSimulator/ directory. Xcode will recreate fresh instances there for you when you do your next simulator run. If you can afford losing any previous simulator data of your apps this is the easy way to get space.
该目录是您用户数据的一部分,您可以删除任何用户数据而不会严重影响 Xcode。您可以删除整个 CoreSimulator/ 目录。当您下次运行模拟器时,Xcode 将为您重新创建新实例。如果您可以承受丢失应用程序的任何先前模拟器数据,这是获得空间的简单方法。
Update: A related useful app is "DevCleaner for Xcode" https://apps.apple.com/app/devcleaner-for-xcode/id1388020431
更新:一个相关的有用应用程序是“DevCleaner for Xcode” https://apps.apple.com/app/devcleaner-for-xcode/id1388020431
回答by whyoz
for Xcode 8:
对于 Xcode 8:
What I do is run sudo du -khd 1in the Terminal to see my file system's storage amounts for each folder in simple text, then drill up/down into where the huge GB are hiding using the cdcommand.
我所做的是在终端中运行sudo du -khd 1以简单文本形式查看每个文件夹的文件系统存储量,然后使用cd命令向上/向下钻取巨大 GB 的隐藏位置。
Ultimately you'll find the Users//Library/Developer/CoreSimulator/Devicesfolder where you can have little concern about deleting all those "devices" using iOS versions you no longer need. It's also safe to just delete them all, but keep in mind you'll lose data that's written to the device like sqlite files you may want to use as a backup version.
最终,您将找到Users//Library/Developer/CoreSimulator/Devices文件夹,您无需担心使用不再需要的 iOS 版本删除所有这些“设备”。将它们全部删除也是安全的,但请记住,您将丢失写入设备的数据,例如您可能想要用作备份版本的 sqlite 文件。
I once saved over 50GB doing this since I did so much testing on older iOS versions.
由于我在较旧的 iOS 版本上进行了大量测试,因此我曾经节省了超过 50GB 的内存。
回答by Alexander of Norway
If you happen to be an iOS developer
:
如果您碰巧是iOS developer
:
Check how many simulators that you have downloaded as they take up a lot of space:
检查您下载了多少模拟器,因为它们占用了大量空间:
Go to: Library/Developer/Xcode/iOS DeviceSupport
去: Library/Developer/Xcode/iOS DeviceSupport
Also delete old archived apps:
同时删除旧的存档应用程序:
Go to: Library/Developer/Xcode/Archives
去: Library/Developer/Xcode/Archives
I cleared 100GB doing this.
我清除了 100GB 这样做。