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

2

43

My ~/Library/Developer/Xcode folder 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.

Amongst the folders such as:

  • Archives
  • DerivedData
  • Installs
  • iOS Device Logs
  • iOS DeviceSupport
  • Snapshots
  • UserData

What might I be able to delete without ruining my project?

Pareu answered 14/9, 2016 at 2:18 Comment(0)
P
64

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.

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

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.

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

The iOS DeviceSupport 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 anymore. 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.

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

I'd leave the UserData folder alone.

Purely answered 14/9, 2016 at 5:8 Comment(2)
You also have to remove accounts from Xcode->preferences->accounts to remove the associated app from side panel of organizer otherwise even after deleting from everywhere, Xcode will recreate itTelly
How do we find the Archives folder?Derisive
C
11

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.

~/Library/Developer/Xcode/Archives

  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.

~/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.

~/Library/Developer/CoreSimulator (Here's a handy shell command for step 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

Cannikin answered 7/5, 2020 at 12:57 Comment(1)
xcrun simctl delete unavailable is a gem. 40GB back instantly.Reneerenegade

© 2022 - 2024 — McMap. All rights reserved.