Xcode Taking Up Too Much Disk Space? Complete 2025 Cleanup Guide

Updated January 2025 -- 8 min read

If you're an iOS or macOS developer, you've probably noticed Xcode silently consuming massive amounts of disk space. Between DerivedData, iOS Device Support files, old simulators, and archived builds, Xcode can easily use 30-80GB+ of your Mac's storage.

This guide covers every Xcode-related cache, how much space each typically uses, whether it's safe to delete, and the exact commands to clean it up.

30-80GB+

Typical Xcode disk usage on an active developer's Mac

Table of Contents

  1. DerivedData (5-50GB)
  2. iOS Device Support (2-20GB)
  3. Xcode Archives (1-10GB)
  4. iOS Simulators (5-30GB)
  5. Xcode Caches (1-5GB)
  6. CoreSimulator Devices (2-15GB)
  7. Old SDKs and Toolchains (1-5GB)
  8. Swift Package Manager Cache (1-5GB)
  9. Summary Table
  10. Automated Cleanup Tools

1. DerivedData

5-50GB

DerivedData is the biggest offender. It contains build products, indexes, and logs for every Xcode project and workspace you've opened.

Location

~/Library/Developer/Xcode/DerivedData/

What's Inside

Is It Safe to Delete?

Yes, completely safe. Xcode regenerates everything automatically when you build your project. You'll just experience a slightly longer first build.

How to Clean

# Delete all DerivedData
rm -rf ~/Library/Developer/Xcode/DerivedData

# Or delete a specific project's data
rm -rf ~/Library/Developer/Xcode/DerivedData/YourProject-*

# Check size before deleting
du -sh ~/Library/Developer/Xcode/DerivedData

You can also clean from within Xcode: Settings > Locations > DerivedData -- click the arrow to open in Finder.

2. iOS Device Support

2-20GB

Every time you connect a physical iOS device, Xcode downloads debug symbols for that device's iOS version. These accumulate over years.

Location

~/Library/Developer/Xcode/iOS DeviceSupport/

What's Inside

Debug symbol files for each iOS version you've ever connected. Each version is 2-4GB. If you've been developing for several years, you might have symbols for iOS 14, 15, 16, 17, and 18.

Is It Safe to Delete?

Yes, safe to delete old versions. Keep the version(s) matching your current test devices. Xcode re-downloads symbols when you connect a device.

How to Clean

# See sizes per iOS version
du -sh ~/Library/Developer/Xcode/iOS\ DeviceSupport/*

# Delete all (Xcode will re-download as needed)
rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport/*

# Delete only old versions (keep 18.x)
find ~/Library/Developer/Xcode/iOS\ DeviceSupport -maxdepth 1 -name "1[4567]*" -exec rm -rf {} +

3. Xcode Archives

1-10GB

Location

~/Library/Developer/Xcode/Archives/

What's Inside

Every time you archive a build for App Store submission or ad-hoc distribution, Xcode saves the full archive (.xcarchive). These include the compiled app, dSYM files, and Info.plist.

Is It Safe to Delete?

Be careful. Archives contain dSYM files needed to symbolicate crash reports. Keep archives for app versions currently in production. Old versions you no longer support can be safely deleted.

How to Clean

# Check total size
du -sh ~/Library/Developer/Xcode/Archives

# Open in Finder to review individually
open ~/Library/Developer/Xcode/Archives

# Or use Xcode Organizer: Window > Organizer > Archives
# Right-click to delete specific archives

4. iOS Simulators

5-30GB

Xcode installs simulator runtimes for each iOS version. Each runtime is 5-7GB, and they accumulate if you don't clean up after Xcode updates.

Location

# Simulator runtimes (macOS 14+)
/Library/Developer/CoreSimulator/Volumes/

# Older macOS
~/Library/Developer/CoreSimulator/Profiles/Runtimes/

Is It Safe to Delete?

Yes, old runtimes are safe to delete. Keep the runtime(s) you actively test against. You can always re-download them from Xcode > Settings > Platforms.

How to Clean

# List installed simulator runtimes
xcrun simctl runtime list

# Delete unavailable/orphaned simulators
xcrun simctl delete unavailable

# Delete a specific runtime (get the identifier from the list above)
xcrun simctl runtime delete <identifier>

# List all simulators and their sizes
xcrun simctl list devices

You can also manage simulators from Xcode > Settings > Platforms.

5. Xcode Caches

1-5GB

Locations

~/Library/Caches/com.apple.dt.Xcode/
~/Library/Caches/com.apple.dt.XCTRunner/

Is It Safe to Delete?

Yes, completely safe. These are just caches that Xcode recreates automatically.

How to Clean

rm -rf ~/Library/Caches/com.apple.dt.Xcode
rm -rf ~/Library/Caches/com.apple.dt.XCTRunner

6. CoreSimulator Device Data

2-15GB

Each simulator device has its own data directory with installed apps, app data, and system files.

Location

~/Library/Developer/CoreSimulator/Devices/

Is It Safe to Delete?

Mostly safe. Deleting removes simulator-installed apps and their data. Your source code is not affected. Use the simctl command to cleanly remove unavailable devices.

How to Clean

# Best approach: remove unavailable devices
xcrun simctl delete unavailable

# Erase all simulator content and settings
xcrun simctl erase all

# Check total size
du -sh ~/Library/Developer/CoreSimulator/Devices

7. Old SDKs and Toolchains

1-5GB

If you've installed additional Swift toolchains or have leftover files from old Xcode versions:

Location

# Custom toolchains
~/Library/Developer/Toolchains/

# Command line tools (separate from Xcode)
/Library/Developer/CommandLineTools/

How to Clean

# Remove custom toolchains you no longer use
ls ~/Library/Developer/Toolchains/

# If you're using Xcode, you can safely remove standalone command line tools
# (Xcode includes its own)
sudo rm -rf /Library/Developer/CommandLineTools

8. Swift Package Manager Cache

1-5GB

SPM caches downloaded package sources and resolved artifacts.

Location

~/Library/Caches/org.swift.swiftpm/
~/Library/org.swift.swiftpm/

Is It Safe to Delete?

Yes, safe. SPM re-downloads packages when you resolve dependencies. Deleting just means a longer first build.

How to Clean

# Clean SPM cache
rm -rf ~/Library/Caches/org.swift.swiftpm
rm -rf ~/Library/org.swift.swiftpm

# Or use Swift's built-in command
swift package purge-cache

# Reset package resolution in Xcode
# File > Packages > Reset Package Caches

Summary: All Xcode Storage Locations

Category Location Typical Size Safe to Delete?
DerivedData ~/Library/Developer/Xcode/DerivedData 5-50GB Yes
iOS Device Support ~/Library/Developer/Xcode/iOS DeviceSupport 2-20GB Yes (old versions)
Archives ~/Library/Developer/Xcode/Archives 1-10GB Keep production
Simulator Runtimes /Library/Developer/CoreSimulator/Volumes 5-30GB Yes (old runtimes)
Xcode Caches ~/Library/Caches/com.apple.dt.Xcode 1-5GB Yes
CoreSimulator Devices ~/Library/Developer/CoreSimulator/Devices 2-15GB Yes (unavailable)
Swift Toolchains ~/Library/Developer/Toolchains 1-5GB Yes (unused)
SPM Cache ~/Library/Caches/org.swift.swiftpm 1-5GB Yes

One-Click Cleanup with ClearDisk

Running these commands manually every week gets tedious. ClearDisk is a free, open-source macOS menu bar app that:

Clean All Xcode Caches in One Click

ClearDisk detects DerivedData, Device Support, Simulators, SPM cache, and 15+ other developer caches. Free and open source.

View on GitHub

Install via Homebrew

brew tap bysiber/cleardisk && brew install --cask cleardisk

Or Download Directly

Grab the latest DMG from GitHub Releases.


Quick One-Liner: Clean Everything

If you prefer the terminal approach, here's a script that cleans all Xcode caches in one go:

#!/bin/bash
# Clean all Xcode caches
echo "Cleaning DerivedData..."
rm -rf ~/Library/Developer/Xcode/DerivedData

echo "Cleaning iOS Device Support..."
rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport

echo "Cleaning Xcode Cache..."
rm -rf ~/Library/Caches/com.apple.dt.Xcode

echo "Cleaning SPM Cache..."
rm -rf ~/Library/Caches/org.swift.swiftpm

echo "Removing unavailable simulators..."
xcrun simctl delete unavailable

echo "Done! Restart Xcode for best results."
Note: This script does NOT delete Archives (you may need dSYMs) or simulator runtimes (re-download is slow). Remove those manually after reviewing.