xcode 我可以从 iOS DeviceSupport 中删除数据吗?

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

Can I delete data from iOS DeviceSupport?

xcodexcode8delete-file

提问by 3x14

After going through and cleaning my disk with old things that I didn't need anymore, I came across the iOS?DeviceSupport folder in ~/User/Library/Developer/Xcodewhich was taking nearly 20?GB.

在使用我不再需要的旧东西清理我的磁盘后,我遇到了 iOS?DeviceSupport 文件夹,~/User/Library/Developer/Xcode其中占用了近 20?GB。

A similar question has been asked before, but since then many things have changed and I would like an up-to-date answer.

之前也有人问类似的问题,但从那以后很多事情都发生了变化,我想要一个最新的答案。

As long as I have the version I use for testing, can I delete the older/unused versions without breaking anything?

只要我有用于测试的版本,我可以删除旧的/未使用的版本而不破坏任何东西吗?

screenshot

截屏

回答by rmaddy

The ~/Library/Developer/Xcode/iOS DeviceSupportfolder is basically only needed to symbolicate crash logs.

~/Library/Developer/Xcode/iOS DeviceSupport文件夹基本上只用于符号化崩溃日志。

You could completely purge the entire folder. Of course the next time you connect one of your devices, Xcode would redownload the symbol data from the device.

您可以完全清除整个文件夹。当然,下次您连接其中一台设备时,Xcode 会从该设备重新下载符号数据。

I clean out that folder once a year or so by deleting folders for versions of iOS I no longer support or expect to ever have to symbolicate a crash log for.

我每年清理一次该文件夹,方法是删除 iOS 版本的文件夹,我不再支持或期望永远必须为其符号化崩溃日志。

回答by Jamshed Alam

More Suggestive answer supporting rmaddy's answer as our primary purpose is to delete unnecessary file and folder:

支持 rmaddy 答案的更多提示性答案,因为我们的主要目的是删除不必要的文件和文件夹:

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

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

     ~/Library/Developer/Xcode/DerivedData
    
  1. 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.

    ~/Library/Developer/Xcode/Archives
    
  2. 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.

    ~/Library/Developer/Xcode/iOS DeviceSupport
    
  3. 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.

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

    ~/Library/Developer/Xcode/Archives
    
  2. 当您连接设备时,iOS 设备支持文件夹会创建一个子文件夹,以设备版本作为标识符。大多数时候它只是旧的东西。保留最新版本,其余的可以删除(如果您没有在 5.1.1 上运行的应用程序,则没有理由保留 5.1.1 目录/目录)。如果你真的不需要这些,请删除。但是我们应该保留一些,尽管我们主要从设备测试应用程序。

    ~/Library/Developer/Xcode/iOS DeviceSupport
    
  3. 许多 Xcode 用户都熟悉 Core Simulator 文件夹。这是模拟器的领域;那就是它存储应用程序数据的地方。很明显,如果您不再支持这些版本的应用程序,您可以丢弃旧版本的模拟器文件夹/文件夹。因为它是用户数据,所以如果你完全删除它也没什么大问题,但使用菜单中的“重置内容和设置”选项来删除模拟器中的所有应用数据会更安全。

    ~/Library/Developer/CoreSimulator 
    

(Here's a handy shell command for step 5: xcrun simctl delete unavailable)

(下面是步骤5一个方便的外壳命令:xcrun simctl delete unavailable

  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!

    ~/Library/Caches/com.apple.dt.Xcode
    
  2. 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 safe 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.

    ~/Library/Application Support/MobileSync/Backup
    

Source: https://ajithrnayak.com/post/95441624221/xcode-users-can-free-up-space-on-your-mac

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

    ~/Library/Caches/com.apple.dt.Xcode
    
  2. 此外,Apple iOS 设备每次连接到您的 Mac 计算机时,都会自动将特定文件和设置同步到您的 Mac。为安全起见,明智的做法是使用 iTunes 首选项的“设备”面板删除旧备份;您应该保留最近的备份。

    ~/Library/Application Support/MobileSync/Backup
    

来源https: //ajithrnayak.com/post/95441624221/xcode-users-can-free-up-space-on-your-mac

I got back about 40GB!

我找回了大约 40GB!

回答by Jamshed Alam

Yes, you can delete data from iOS device support by 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

是的,您可以通过操作系统的符号从 iOS 设备支持中删除数据,每个体系结构的每个版本对应一个。它用于调试。如果您不再需要支持这些设备,您可以删除该目录而不会产生不良影响