Reputation: 338171
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:
What might I be able to delete without ruining my project?
Upvotes: 45
Views: 30001
Reputation: 318774
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.
Upvotes: 66
Reputation: 121
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
~/Library/Developer/Xcode/iOS DeviceSupport
~/Library/Developer/CoreSimulator (Here's a handy shell command for step 5: xcrun simctl delete unavailable)
~/Library/Caches/com.apple.dt.Xcode
Upvotes: 12