What can I delete from ~/Library/Developer/Xcode folder?
Here is explantation for each folder and what you can delete to reduce the size.
DeviceSupport - You can keep the simulator which log's you may need in future. It's symbolicate crash logs for different device/iOS.
Delete this folder after every few days interval. Most of the time, it occupy huge space!
~/Library/Developer/Xcode/DerivedData
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
- 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
- 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)
- 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
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.