~/Library/Developer/Xcode/iOS DeviceSupport/<iOS Version>/Symbols/System/Library 消耗 14+GB 的 Mac 磁盘空间
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33322832/
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
~/Library/Developer/Xcode/iOS DeviceSupport/<iOS Version>/Symbols/System/Library consuming 14+GB of my Mac disk space
提问by Steven Lu
I have entries in here ranging back to a large number of iOS versions (many GB are for old iOS 8 versions and there are many iOS 6 and 7 versions as well).
我在这里的条目可以追溯到大量的 iOS 版本(许多 GB 用于旧的 iOS 8 版本,还有许多 iOS 6 和 7 版本)。
I don't expect to care about building apps in Xcode to support these iOS versions any more (maybe I will care about iOS 8.4 for a few more months), I might build an app for some of the older iOS versions on a whim, but certainly am happy to give up the ability to do so if I can reclaim 10 or so GB of my disk.
我不希望再关心在 Xcode 中构建应用程序来支持这些 iOS 版本(也许我会再关心 iOS 8.4 几个月),我可能会一时兴起为一些较旧的 iOS 版本构建一个应用程序,但如果我可以回收 10 GB 左右的磁盘,我当然很高兴放弃这样做的能力。
Does anyone know how safe it is to remove these directories? What of value can possibly be contained within them?
有谁知道删除这些目录有多安全?它们中可能包含什么价值?
采纳答案by Stephen Darlington
It's the symbols of the operating system, one for each version for each architecture. It's used for debugging. If you don't need to support those devices any more, you can delete the directory without ill effect.
它是操作系统的符号,每个体系结构的每个版本都有一个符号。它用于调试。如果您不再需要支持这些设备,您可以删除该目录而不会产生不良影响。
回答by Steven Lu
@StephenDarlington 's answer is very clear.
@StephenDarlington 的回答非常明确。
I also wanted to add a reference to (and a text mirror of) this helpful articlethat I found which goes into some more depth about some other similar directories.
我还想添加对我发现的这篇有用文章的引用(和文本镜像),它更深入地介绍了一些其他类似的目录。
The author updated the article for Xcode 7.0.1 in Oct 2015.
作者在 2015 年 10 月更新了 Xcode 7.0.1 的文章。
~/Library/Developer/Xcode/DerivedData
The Derived Data folder here contains all of your project's intermediate build information, index and debug/release built targets. You will generally delete this data when you observe peculiar behaviour like improper indexing or slowness of Xcode. Deleting all folders(Not derived data folder itself) from derived data will just make all your projects to be recreated when you build again; rebuilding will be bit slower.
Tip: Open
Window > Projects
. Select the desired project and click the Delete button next to the Derived Data path.~/Library/Developer/Xcode/Archives
All your targets are kept in archived form in Archives folder. Before you decide to delete contents of this folder, here is a warning - if you want to be able to debug deployed versions of your App, you shouldn't delete the archives.
~/Library/Developer/Xcode/iOS DeviceSupport
iOS Device Support folder creates a subfolder with the device version as identifier when you attach the device. Most of the time it's just old stuff. Keep the latest version and rest of them can be deleted (if you don't have an app that runs on 5.1.1, there's no reason to keep the 5.1.1 directory/directories). If you still have a device running a particular version, the directory will be recreated by Xcode when you attach the device. And, no, this has nothing to do with simulator.
Caution: You'll want to be careful when removing files from inside
/Library
and/Users/<yourusername>/Library
as deleting the wrong files can cause applications, and even the OS, to misbehave.~/Library/Developer/CoreSimulator
Core Simulator folder is familiar for many Xcode users. It's simulator's territory; thats where it stores app data. It's obvious that you can toss the older version simulator folder/folders if you no longer support your apps for those versions. And, it's safer to use ‘Reset content and Settings' option from menu to delete all of your app data in a Simulator.
Tip: [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; will print the full path to document directory folder.
Note: As we know, simulator location was moved from ~/Library/Application Support/iPhone Simulator since the Xcode 6. So, if you have not cleared out this directory, have a check.
~/Library/Caches/com.apple.dt.Xcode
Caches are always safe to delete since they will be recreated as necessary. This isn't a directory, it's a file of kind Xcode Project. Delete away!
~/Library/Application Support/MobileSync/Backup
Additionally, Apple iOS device automatically syncs specific files and settings to your Mac every time they are connected to your Mac machine. To be on safer side, it's wise to use Devices pane of iTunes preferences to delete older backups; you should be retaining your most recent back-ups off course.
〜/图书馆/开发人员/Xcode/DerivedData
此处的派生数据文件夹包含项目的所有中间构建信息、索引和调试/发布构建目标。当您观察到不正确的索引或 Xcode 缓慢等特殊行为时,您通常会删除这些数据。从派生数据中删除所有文件夹(不是派生数据文件夹本身)只会在您再次构建时重新创建所有项目;重建会慢一点。
提示:打开
Window > Projects
. 选择所需的项目,然后单击派生数据路径旁边的删除按钮。〜/图书馆/开发人员/Xcode/档案
您的所有目标都以存档形式保存在 Archives 文件夹中。在您决定删除此文件夹的内容之前,这里有一个警告 - 如果您希望能够调试已部署的应用程序版本,则不应删除存档。
~/Library/Developer/Xcode/iOS DeviceSupport
当您连接设备时,iOS 设备支持文件夹会创建一个以设备版本作为标识符的子文件夹。大多数时候它只是旧的东西。保留最新版本,其余的可以删除(如果您没有在 5.1.1 上运行的应用程序,则没有理由保留 5.1.1 目录/目录)。如果您仍有运行特定版本的设备,当您连接设备时,Xcode 将重新创建该目录。而且,不,这与模拟器无关。
注意:从内部删除文件时要小心
/Library
,/Users/<yourusername>/Library
因为删除错误的文件会导致应用程序甚至操作系统出现异常行为。~/库/开发人员/CoreSimulator
许多 Xcode 用户都熟悉 Core Simulator 文件夹。这是模拟器的领域;那就是它存储应用程序数据的地方。很明显,如果您不再支持这些版本的应用程序,您可以丢弃旧版本的模拟器文件夹/文件夹。而且,使用菜单中的“重置内容和设置”选项来删除模拟器中的所有应用数据会更安全。
提示:[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; 将打印文档目录文件夹的完整路径。
注意:正如我们所知,模拟器位置从 Xcode 6 开始从 ~/Library/Application Support/iPhone Simulator 移动。所以,如果你还没有清除这个目录,请检查一下。
~/Library/Caches/com.apple.dt.Xcode
缓存总是可以安全删除,因为它们会根据需要重新创建。这不是目录,而是 Xcode Project 类型的文件。删掉!
~/库/应用程序支持/MobileSync/备份
此外,Apple iOS 设备每次连接到您的 Mac 计算机时,都会自动将特定文件和设置同步到您的 Mac。为了安全起见,明智的做法是使用 iTunes 首选项的“设备”面板来删除旧备份;您应该保留最近的备份。