我可以从 ~/Library/Developer/Xcode 文件夹中删除什么?

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

What can I delete from ~/Library/Developer/Xcode folder?

xcodexcode7

提问by Basil Bourque

My ~/Library/Developer/Xcodefolder is over 17 gigs in size. As I work in virtual machine (Parallels 12) with a 64 gig limit in total virtual disk size, I need to recover some disk space.

我的~/Library/Developer/Xcode文件夹大小超过 17 演出。当我在虚拟机 (Parallels 12) 中工作时,总虚拟磁盘大小限制为 64 gig,因此我需要恢复一些磁盘空间。

Amongst the folders such as “Archives”, “DerivedDate”, “Installs”, “iOS Device Logs”, “iOS DeviceSupport”, “Snapshots”, and “UserData”, what might I be able to delete without ruining my project?

在“Archives”、“DerivedDate”、“Installs”、“iOS Device Logs”、“iOS DeviceSupport”、“Snapshots”和“UserData”等文件夹中,我可以删除哪些内容而不破坏我的项目?

回答by rmaddy

Under Archives you can delete anything you want but you should keep recent builds. And you should backup older builds you might need to access in the future.

在 Archives 下,您可以删除任何您想要的内容,但您应该保留最近的版本。您应该备份将来可能需要访问的旧版本。

You can delete everything under DerivedData. Next time you build a project, the needed files will be recreated.

您可以删除 DerivedData 下的所有内容。下次构建项目时,将重新创建所需的文件。

My Installs folder only contains a set of empty folders and the newest if over 3 years old. Check yours, that may be safe to delete.

我的安装文件夹只包含一组空文件夹和最新的,如果超过 3 年。检查你的,删除可能是安全的。

The iOS Device Logs folder contains old device logs for various versions of iOS. You can safely delete many of the older logs.

iOS 设备日志文件夹包含各种 iOS 版本的旧设备日志。您可以安全地删除许多旧日志。

The iOS Device Support folder contains a folder for each version of iOS you ever had on an iOS device you ever connected while Xcode was running. Feel free to delete any folders for versions of iOS you don't support any more. For example, if none of your apps have a Deployment Target older than iOS 8.1, for example, you can safely delete any folder for iOS 8.0.x and earlier. These folders are only needed to symbolicate crash reports.

iOS 设备支持文件夹包含一个文件夹,用于在运行 Xcode 时连接的 iOS 设备上的每个 iOS 版本。随意删除您不再支持的 iOS 版本的任何文件夹。例如,如果您的应用程序的部署目标均不早于 iOS 8.1,则您可以安全地删除 iOS 8.0.x 及更早版本的任何文件夹。这些文件夹仅用于符号化崩溃报告。

The Snapshots folder is used by Xcode to save snapshots (backups). You can delete snapshots for old projects you don't care about.

Xcode 使用 Snapshots 文件夹来保存快照(备份)。您可以删除您不关心的旧项目的快照。

I'd leave the UserData folder alone.

我会单独留下 UserData 文件夹。

回答by Uzgun Gozler

Here is explantation for each folder and what you can delete to reduce the size.

这是每个文件夹的解释以及您可以删除的内容以减小大小。

  1. DeviceSupport - You can keep the simulator which log's you may need in future. It's symbolicate crash logs for different device/iOS.

  2. Delete this folder after every few days interval. Most of the time, it occupy huge space!

    ~/Library/Developer/Xcode/DerivedData

  3. All your targets are kept in the 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. Xcode will manage of archives and creates new file when new build is archived.

  1. DeviceSupport - 您可以保留模拟器,您将来可能需要哪些日志。它是不同设备/iOS 的象征性崩溃日志。

  2. 每隔几天删除此文件夹。大多数时候,它占据了巨大的空间!

    〜/图书馆/开发人员/Xcode/DerivedData

  3. 您的所有目标都保存在 Archives 文件夹中的存档形式中。在您决定删除此文件夹的内容之前,这里有一个警告 - 如果您希望能够调试已部署的应用程序版本,则不应删除存档。Xcode 将管理存档并在新构建存档时创建新文件。

~/Library/Developer/Xcode/Archives

〜/图书馆/开发人员/Xcode/档案

  1. iOS Device Support folder creates a subfolder with the device version as an 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 really don't need these, delete. But we should keep a few although we test app from device mostly.
  1. 当您连接设备时,iOS 设备支持文件夹会创建一个子文件夹,以设备版本作为标识符。大多数时候它只是旧的东西。保留最新版本,其余的可以删除(如果您没有在 5.1.1 上运行的应用程序,则没有理由保留 5.1.1 目录/目录)。如果你真的不需要这些,请删除。但是我们应该保留一些,尽管我们主要从设备测试应用程序。

~/Library/Developer/Xcode/iOS DeviceSupport

~/Library/Developer/Xcode/iOS DeviceSupport

  1. Core Simulator folder is familiar for many Xcode users. It's simulator's territory; that's 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. As it is user data, no big issue if you delete it completely but it's safer to use ‘Reset Content and Settings' option from the menu to delete all of your app data in a Simulator.
  1. 许多 Xcode 用户都熟悉 Core Simulator 文件夹。这是模拟器的领域;那就是它存储应用程序数据的地方。很明显,如果您不再支持这些版本的应用程序,您可以丢弃旧版本的模拟器文件夹/文件夹。因为它是用户数据,所以如果你完全删除它没有什么大问题,但使用菜单中的“重置内容和设置”选项来删除模拟器中的所有应用数据会更安全。

~/Library/Developer/CoreSimulator (Here's a handy shell command for step 5: xcrun simctl delete unavailable)

~/Library/Developer/CoreSimulator(这是第 5 步的一个方便的 shell 命令:xcrun simctl delete 不可用)

  1. 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!
  1. 缓存总是可以安全删除,因为它们会根据需要重新创建。这不是目录;它是一种 Xcode Project 类型的文件。删掉!

~/Library/Caches/com.apple.dt.Xcode

~/Library/Caches/com.apple.dt.Xcode