Jul 25, 2026

How I Cleared 60 GB of Space From Xcode on My Mac

If your Mac is running out of storage and you build apps for Apple devices, Xcode is probably using up your disk space. Here is how I cleaned up my Mac using a few simple terminal commands.

The Problem: Xcode Saves Everything and Never Deletes It

Xcode keeps a lot of old files on your computer. Over time, it saves temporary build files, simulator data, and files from older phone updates. It does not delete these files by itself, so they slowly fill up your hard drive.

When I checked my ~/Library/Developer folder, Xcode and CoreSimulator were taking up 68 GB of space:

  • CoreSimulator: 30 GB
  • Xcode Directory: 38 GB (including 26 GB in iOS DeviceSupport and 9.9 GB in DerivedData)

Step 1: Delete Old Simulators You Can No Longer Use

When you update Xcode or delete older iOS versions, the virtual test phones from those old versions stay on your computer. They take up space with old app data that you cannot even run anymore.

You should not delete these folders manually because it can break Xcode. Instead, run this command in your Terminal:

xcrun simctl delete unavailable

Result: This removed all old virtual phones and reduced my CoreSimulator folder from 30 GB down to just 4.5 GB.

Step 2: Clear Out iOS Device Support Files

When you connect a real iPhone or iPad to your Mac to test an app, Xcode copies system files from that device. The problem is that Xcode creates a new 4 GB to 5 GB folder every time your phone gets an update, and it keeps all the old ones.

These files are inside ~/Library/Developer/Xcode/iOS DeviceSupport. You can safely delete everything in this folder. If you connect your phone again later, Xcode will just download what it needs for that phone.

rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport/*

Result: Freed 26 GB of space instantly.

Step 3: Delete Temporary Build Files (DerivedData)

The DerivedData folder holds temporary files that Xcode creates when it builds your projects. As you work on different projects over time, this folder grows very large.

You can delete all files in this folder without losing any of your project code. The only difference is that Xcode will take a minute to rebuild these files the next time you open a project.

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

Result: Freed almost 10 GB of space.

The Final Result: 62 GB Saved

After running these simple commands, I checked my folder sizes again:

  • CoreSimulator: Went down from 30 GB to 4.5 GB
  • Xcode Directory: Went down from 38 GB to 1.6 GB

In total, I got back 62 GB of free space in under five minutes. If your Mac is short on space, try these three steps first.

0 comments: