Home › Guides

Xcode taking up too much space? What you can safely delete

Updated November 24, 2026

Xcode itself is about 10–15 GB, but the files it creates over time can easily reach 50–100 GB. Most of it is safe to delete because Xcode recreates it when needed. Here's every location, biggest first, with a verdict for each.

To see sizes for all of them at once:

du -sh ~/Library/Developer/Xcode/* ~/Library/Developer/CoreSimulator/* ~/Library/Caches/com.apple.dt.Xcode 2>/dev/null | sort -h

Quit Xcode and the Simulator before deleting anything below.

1. Simulators and simulator runtimes Usually safe

Each iOS, watchOS, tvOS and visionOS runtime is several GB, and every simulator device keeps its own apps and data. Old runtimes for iOS versions you no longer test against are pure waste. This one deserves its own guide: How to delete old iOS simulators and runtimes.

2. DerivedData Safe

~/Library/Developer/Xcode/DerivedData holds build products, indexes and logs. Xcode rebuilds it on your next build.

rm -rf ~/Library/Developer/Xcode/DerivedData

More detail: How to delete Xcode DerivedData.

3. iOS DeviceSupport Safe

When you connect an iPhone or iPad running a new iOS version, Xcode copies that version's debug symbols to ~/Library/Developer/Xcode/iOS DeviceSupport (and watchOS DeviceSupport, tvOS DeviceSupport, visionOS DeviceSupport). Each version is 2–5 GB, and old versions are never removed.

Delete the folders for iOS versions none of your devices run anymore. If you delete one you still need, Xcode simply copies the symbols again the next time you connect that device (it takes a few minutes).

ls ~/Library/Developer/Xcode/"iOS DeviceSupport"
rm -rf ~/Library/Developer/Xcode/"iOS DeviceSupport"/<old-version-folder>

4. Archives Be careful

~/Library/Developer/Xcode/Archives contains every build you archived for TestFlight or the App Store, including its dSYM debug symbols. You need those to read crash reports from that exact version.

5. SwiftUI previews Safe

Xcode Previews run in their own hidden simulators stored in ~/Library/Developer/Xcode/UserData/Previews. They're recreated the next time you open a preview.

xcrun simctl --set previews delete all

6. Xcode caches Safe

~/Library/Caches/com.apple.dt.Xcode and ~/Library/Developer/CoreSimulator/Caches hold downloaded documentation, simulator dyld caches and similar data that's rebuilt on demand.

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

7. Swift Package Manager caches Safe

Packages resolved by Xcode are cached in ~/Library/Caches/org.swift.swiftpm and checked out per project inside DerivedData. Deleting the cache only means packages are downloaded again.

What not to delete

How MacDejunk handles Xcode

MacDejunk scans the locations above (all except the Swift Package Manager cache), shows the size of each, and labels it safe or caution the same way this guide does. DerivedData, DeviceSupport, previews and caches are pre-selected; Archives are never selected for you.

Do it in one click with MacDejunk

MacDejunk is a free Mac app that finds this junk (and the rest of what Xcode, Android, Node, Flutter and Homebrew leave behind), shows what's safe to delete, and frees the space. Everything stays on your Mac.

Download MacDejunk — free