CleanLoupe
FRAME 01 · DEVELOPER

iOS DeviceSupport: Delete Old Folders Safely

You can delete any folder in ~/Library/Developer/Xcode/iOS DeviceSupport for an iOS version that none of your devices runs any more. Keep the folder that matches the version on the iPhone or iPad you debug with today. If you delete that one by mistake, nothing breaks; Xcode copies the symbols again the next time you connect the device, which takes a few minutes.

Below: what these folders are, how to tell old from current, and how to clear them in Finder or Terminal, including the watchOS, tvOS and visionOS versions.

What Xcode puts in DeviceSupport

To show readable stack traces and let you set breakpoints in system frameworks, Xcode needs the debug symbols for the exact OS build running on your device. The first time you connect a device on a new build, Xcode shows "Preparing device for development" or "Copying shared cache symbols" and copies those symbols from the device to your Mac.

They land in one folder per device model and OS build. On a current Xcode the names look like this:

~/Library/Developer/Xcode/iOS DeviceSupport/
  iPhone15,2 17.6.1 (21G93)
  iPhone15,2 18.0 (22A3354)
  iPhone15,2 18.1 (22B83)
  iPad13,4 17.5 (21F79)

The first part is the hardware identifier (iPhone15,2), then the OS version, then the build number in parentheses. Older Xcode versions used names with only the version and build, without the model.

Every iOS point release you install on a test device adds another folder, and each one is large because it holds a copy of the system's shared libraries. Nothing ever removes the old ones, so a Mac that has followed several iOS release cycles can accumulate many gigabytes here.

The sibling folders

The same thing happens for Apple's other platforms, each in its own folder next to the iOS one:

  • ~/Library/Developer/Xcode/watchOS DeviceSupport
  • ~/Library/Developer/Xcode/tvOS DeviceSupport
  • ~/Library/Developer/Xcode/visionOS DeviceSupport

If you have ever debugged a watch app, check the watchOS folder too. Apple Watch symbols are copied through the paired iPhone, and the folder grows on the same pattern.

Step 1: measure

cd ~/Library/Developer/Xcode
du -sh *DeviceSupport 2>/dev/null

# Size of each folder inside the iOS one
du -sh "iOS DeviceSupport"/* 2>/dev/null | sort -h

The quotes matter because the folder name contains a space. If a folder is missing, you simply have never connected that kind of device.

Step 2: decide what to keep

Check what your devices run now. On the iPhone, open Settings › General › About and look at iOS Version; the build number appears when you tap the version. Or, with the device connected, open Xcode's Window › Devices and Simulators and read the version under the device name.

Then apply three rules:

  1. Keep the folder matching each device's current OS build.
  2. Delete folders for builds older than that, unless you keep a second device on an older OS on purpose for testing.
  3. Delete folders for devices you no longer own or borrow.

Beta builds are worth a special look. If you ran a beta and then updated to the release, the beta folder is left behind and will never be used again.

Step 3a: delete in Finder

  1. In Finder, press Shift-Command-G and enter ~/Library/Developer/Xcode/iOS DeviceSupport.
  2. Choose View › as List and sort by Name, so all folders for one device sit together in version order.
  3. Command-click the folders you decided to remove.
  4. Choose File › Move to Trash.
  5. Repeat for the watchOS, tvOS and visionOS folders if they exist.
  6. Empty the Trash when you are done.

Finder's Get Info (Command-I) on a folder shows its size if you want to check before moving it.

Step 3b: delete in Terminal

Terminal is faster when there are many folders. This removes everything in the iOS folder except folders whose names contain the build you name. Replace 22B83 with your current build and look at the list before deleting.

cd ~/Library/Developer/Xcode/"iOS DeviceSupport"

# Preview: folders that would be removed
ls -1 | grep -v "22B83"

# Remove them (permanent, does not use the Trash)
ls -1 | grep -v "22B83" | while IFS= read -r d; do rm -rf "$d"; done

If you debug more than one device on different builds, extend the filter, for example grep -v -e "22B83" -e "21G93". The while read loop handles the spaces and commas in the folder names safely.

To clear an entire platform you no longer develop for:

rm -rf ~/Library/Developer/Xcode/"tvOS DeviceSupport"

What happens if you delete the current one

Nothing permanent. The next time you connect that device, Xcode shows the preparing or copying message again and rebuilds the folder. Until it finishes, you can still build and run, but the debugger may be slow to attach and stack traces in system code may be less readable. On a fast cable it is usually a short wait, over Wi-Fi debugging it takes longer.

That is the whole cost, which is why these folders are among the easier wins on a developer Mac. If you are working through the rest of ~/Library/Developer, the guide to deleting Xcode DerivedData covers build products, and deleting old Xcode simulators and runtimes covers the CoreSimulator folders.

Two smaller folders sit next to DeviceSupport and follow the same logic:

  • ~/Library/Developer/Xcode/iOS Device Logs holds crash and console logs pulled from devices. Old ones are safe to remove once you have filed whatever bug they belonged to.
  • iPhone and iPad backups made by Finder are not developer files at all; they live in ~/Library/Application Support/MobileSync/Backup and you manage them from the device's page in Finder. See deleting iPhone backups on a Mac if those are what is filling your disk.

How CleanLoupe does it

The Developer group in CleanLoupe's Cleanup module lists iOS, watchOS, tvOS and visionOS DeviceSupport folders individually, with sizes, labelled Safe. The difference from a blind delete is in the preselection: for each device, the newest folder is shown but never ticked for you. Older builds are ticked, and you can untick any you want to keep for testing.

Clicking Clean moves the selected folders to the Trash and records them in History, so Put Back can restore a folder until you empty the Trash. That is handy if you realise a colleague's older test phone still needed it. iOS Device Logs appear in the same group, also Safe.

What it does not do: it cannot see what OS your devices run right now, so "newest per device" means newest on disk, not necessarily the one on your phone today. If you have updated a phone and not reconnected it yet, check the build yourself as described in Step 2. CleanLoupe is free, with no subscription, trial or account.

For every other developer folder worth checking, see freeing up disk space on a developer Mac.

FAQ

Can I delete iOS DeviceSupport files?

Yes. They are debug symbols copied from your devices, and Xcode copies them again whenever it needs them. Delete folders for OS versions you no longer run, and keep the one matching each device's current version to avoid waiting for a new copy.

What is the watchOS DeviceSupport folder?

It is the Apple Watch equivalent of iOS DeviceSupport: symbols for each watchOS build you have debugged, copied through the paired iPhone. Old watchOS builds can be deleted on the same rules. The folder is at ~/Library/Developer/Xcode/watchOS DeviceSupport.

Why does Xcode say "Copying shared cache symbols" every time?

Xcode does this when it has no folder for the exact OS build on the connected device, for example after an iOS update or after you cleared the folder. It should happen once per build. If it repeats for the same build, check that the folder is not being removed by a script or a sync tool.

Will deleting DeviceSupport affect my apps or provisioning profiles?

No. Provisioning profiles, certificates and your apps are stored elsewhere. DeviceSupport only holds system symbols used by the debugger.

To see your DeviceSupport folders sorted by device with the newest left unticked, download CleanLoupe.

FRAME 12 · KEEP READING