554

After going through and cleaning my disk with old things that I didn't need anymore, I came across the iOS DeviceSupport folder in ~/Library/Developer/Xcode which was taking nearly 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?

iOS DeviceSupport contents

Paulo Mattos
  • 16,310
  • 10
  • 64
  • 73
3x14
  • 5,679
  • 3
  • 10
  • 24

5 Answers5

869

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

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.

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.

rmaddy
  • 298,130
  • 40
  • 468
  • 517
  • 43
    just as few as 41GB of data there, it does not make sense! So it's a good idea to remove mostly unused iOS versions as explained here! thanks – loretoparisi Sep 27 '16 at 09:34
  • 2
    Note that the documentation is downloaded only from a real attached device. If you get a crash report from a client device with a different iOS version as yours, you won't be able to read the crash report if that version is not in "iOS DeviceSupport". – fishinear Nov 11 '16 at 14:45
  • 11
    Or just delete `~/Library/Developer/Xcode/iOS DeviceSupport/*/Symbols/System/Library/Caches/*` — still recovers a significant chunk of storage, but you still have the legacy device support there, should you later need it. – t0rst Feb 19 '17 at 11:16
  • 13
    One of the greatest answers on Stack Overflow - did this and instantly purged 40 GB of storage – GJZ May 06 '17 at 14:27
  • 1
    I work with a lot of iPads; did this and cleared out more than 60gb. – Jeff McMahan Dec 08 '17 at 14:38
  • Thank you so much! The whole size inside `~/Library/Developer/Xcode` for me is 94 GB, but `iOS DeviceSupport` takes up almost all of it. This helps me reclaim around 90 GB by deleting un-needed directories of those infrequent used devices. Thanks again. – haxpor Jan 05 '18 at 19:03
  • So will I get *everything* back when I reconnect my device, even my old symbolicated crash logs? – ma11hew28 Apr 28 '20 at 14:58
  • I just tested it (by moving the folder, recreating it with Xcode, and then diffing). And no, I didn't get everything back. (Note: I've only ever set up one device (my iPhone) for development with Xcode. For me, this folder only contained folders, each named according to an iOS version & build, eg, "13.4.1 (17E262)".) I lost the folders for older versions of iOS that I guess my iPhone had. I also lost the value of the `DateCollected` key in the `Info.plist` file inside the folder of the current version of iOS that my iPhone has. I don't know about crash logs because my iPhone has none on it. – ma11hew28 Apr 28 '20 at 15:53
  • Is it possible to change the iOS DeviceSupport default folder location? I want it to point to an external drive and save some memory on main drive.. – OldSchool Apr 03 '21 at 15:24
458

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

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

      ~/Library/Developer/Xcode/DerivedData
    
  2. 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
    
  3. 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
    
  4. 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
    
  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

I got back about 40GB!

Mithun Ravindran
  • 1,986
  • 2
  • 11
  • 23
Jamshed Alam
  • 10,887
  • 5
  • 22
  • 42
  • I'm using Xcode 8.1 and I've deleted the content of Archives, CoreSimulator, DerivedData, iOS DeviceSupport and Products (as I was not managing any of my product anymore). I also got back aprox. 40GB. BUT Xcode started doing excessed CPU work without any reason. I'll provide more feedback over time. – Andrej Nov 09 '16 at 10:10
  • And I was wondering where did all of my free space go. Deleting all of these (besides some archives I actually needed) gave me 42GB of space back. Thanks for this answer! – Lucas P. Oct 16 '19 at 09:41
  • 2
    since a big part of this answer is copied from the quoted website, please add proper attribution: https://stackoverflow.com/help/referencing – Jean-François Fabre Jan 10 '20 at 20:38
  • i got back around 63.31 GB free :) – Maheta Dhaval K Jul 10 '20 at 13:23
  • 1
    Woah! Running `xcrun simctl delete unavailable` freed 33 GBs! – dev gr Jul 24 '20 at 12:49
  • This got back around 30 GB in my system. Thanks – Hardy Sep 02 '20 at 05:38
  • I got around 200GB. Thanks Jamshed Alam – Damitha Raveendra Nov 04 '20 at 09:13
1

I wrote a small command-line utility based on the great answer by @JamshedAlam for those who are tired of deleting the contents of those folders manually. Check it out here if you think it would help you.

lajosdeme
  • 1,535
  • 1
  • 5
  • 16
0

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

0

DevCleaner is a great MacOs app which let you manage and delete all unnecessary Xcode files. I highly recommend to use it.