Xcode taking up space on Mac? Clear DerivedData, simulators, device support and archives
To clear Xcode DerivedData, quit Xcode and run rm -rf ~/Library/Developer/Xcode/DerivedData; Xcode rebuilds it on the next build. The rest of Xcode's space usually sits in simulator runtimes, simulator devices, device support files and archives. Runtimes, devices, DerivedData and caches come back when needed. Archives of shipped builds don't: keep them.
| What | Where | Safe to remove? |
|---|---|---|
| DerivedData | ~/Library/Developer/Xcode/DerivedData | Yes. Rebuilt on the next build, which is slower. |
| Simulator devices | ~/Library/Developer/CoreSimulator/Devices | Yes, with xcrun simctl. Apps and data inside them are lost. |
| Simulator runtimes | System location managed by macOS | Yes, with xcrun simctl runtime or Xcode settings. Downloaded again when needed. |
| Device support | ~/Library/Developer/Xcode/iOS DeviceSupport (and watchOS, tvOS) | Old OS versions, yes. Copied again when you connect a device. |
| Archives | ~/Library/Developer/Xcode/Archives | Only test builds. Keep every shipped build. |
| Xcode cache | ~/Library/Caches/com.apple.dt.Xcode | Yes, with Xcode quit. |
| SwiftUI previews | ~/Library/Developer/Xcode/UserData/Previews | Yes, with Xcode quit. Rebuilt when you open a preview. |
See where Xcode's space goes
These two commands only read sizes and delete nothing. The first lists the folders under Xcode's data and the simulator folder, smallest to largest:
du -sh ~/Library/Developer/Xcode/* ~/Library/Developer/CoreSimulator 2>/dev/null | sort -h
The second lists installed simulator runtimes. In recent Xcode versions they are separate downloads stored outside Xcode.app and outside your home folder, so du above does not see them; each one takes several gigabytes. On many Macs they show up as System Data in Storage settings.
xcrun simctl runtime list
Delete Xcode DerivedData folder
DerivedData holds build products, the index and build logs for every project you have opened. It is the safest thing to delete: Xcode creates it again. The cost is time, because the next build and indexing start from scratch and Swift packages may be fetched again.
From the command line
- Quit Xcode and stop any
xcodebuildruns, so nothing is writing to the folder. - Run:
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf deletes at once, without the Trash. Copy the line exactly: the path starts with ~/, without a space in it. Xcode creates an empty DerivedData folder the next time it builds.
If you changed the location in Xcode's Locations settings, the folder is elsewhere. This command prints your custom path, or an error if you use the default:
defaults read com.apple.dt.Xcode IDECustomDerivedDataLocation
One project only
Each project has its own folder named after it plus a random suffix, such as MyApp-abcdefghijklmn. To keep the projects you are working on fast, open ~/Library/Developer/Xcode/DerivedData in Finder (Go to Folder) and move only old projects' folders to the Trash.
Clean Build Folder in Xcode is not the same: it removes the build products of the open project and leaves its index and every other project's data in place.
Delete old simulators and simulator runtimes
There are two layers. A runtime is the iOS, watchOS, tvOS or visionOS system image, several gigabytes each. A device is one simulated iPhone or iPad on top of a runtime, with the apps and data you installed in it.
Simulator devices
This removes devices that the current Xcode no longer supports, usually left from older Xcode versions:
xcrun simctl delete unavailable
It deletes the devices' data immediately, without the Trash. To remove one specific device, find its identifier with xcrun simctl list devices and run xcrun simctl delete followed by that identifier. Shut down a simulator before deleting it.
Simulator runtimes
Runtimes take the most space. Never delete them in Finder; use Xcode's settings, where installed platforms and runtimes are listed and can be deleted, or simctl. Preview first: --dry-run only prints what would be deleted.
xcrun simctl runtime delete --notUsedSinceDays 90 --dry-run
If the list looks right, run the same command without --dry-run. Simulator devices that run on a deleted runtime become unusable, and a later xcrun simctl delete unavailable deletes them together with their apps and data. To delete one runtime, pass its identifier from xcrun simctl runtime list instead. These options exist in recent Xcode versions; xcrun simctl help runtime shows what your Xcode supports. A deleted runtime can be downloaded again in Xcode when a project needs it.
Remove old iOS DeviceSupport files
When you connect an iPhone or iPad to run or debug an app, Xcode copies that device's system symbols to your Mac, one folder per device model and OS version, for example iPhone16,2 18.3 (22D63). They pile up with every iOS update.
Open ~/Library/Developer/Xcode/iOS DeviceSupport (and watchOS DeviceSupport or tvOS DeviceSupport if you have them) and move folders of OS versions you no longer debug on to the Trash. Keep the versions on the devices you use now. If you need an old one later, Xcode copies it again when you connect that device; the first connection takes longer.
Xcode archives: what to keep
Archives are the builds you made for TestFlight, the App Store or ad hoc distribution. Unlike everything above, they can't be rebuilt exactly: each holds the dSYM files that turn crash reports of that build into readable stack traces, and a dSYM only matches the exact build it came from.
- Keep the archive of every version that users still run.
- Delete test and internal builds you will never symbolicate, in Xcode's Organizer or by moving folders from
~/Library/Developer/Xcode/Archivesto the Trash. - If you want to keep old archives but free the disk, move them to an external drive.
Xcode caches, previews and old Xcode copies
- Xcode cache (
~/Library/Caches/com.apple.dt.Xcode) and SwiftUI previews (~/Library/Developer/Xcode/UserData/Previews): quit Xcode, then move them to the Trash. Xcode recreates them. - Old Xcode copies. A second Xcode or an old beta in Applications takes a lot of space. Delete the app you no longer use, after checking it is not the one selected for command-line tools (
xcode-select -pprints the selected one). - CocoaPods cache:
pod cache clean --allclears it; pods are downloaded again on the next install.
Not Xcode, but often next to it on a developer's Mac: node_modules folders of old projects and Docker images. 1Cleaner for Mac lists those too.
Where 1Cleaner for Mac helps with Xcode
1Cleaner for Mac is a free Mac cleaner with a developer cleaner built in. It finds the items in this guide in one scan and shows the sizes, so you don't have to remember the paths:
- Xcode DerivedData, caches, SwiftUI previews, device support files and archives. The newest archive of each app is labeled Risky.
- Simulator devices and iOS runtimes, with an explanation of Device and Runtime. They are removed by Xcode's own tools after a separate warning, never through the Trash. A runtime is locked while a simulator on it runs.
- Other Xcode copies in Applications. The selected Xcode is never offered, also when it sits behind a link, and a running Xcode is locked.
- Also project build folders such as
node_modulesandPods, package-manager caches, Android SDK files and Docker data.

Nothing is selected for you. Each item is labeled Safe, Ask AI or Risky, and files go to the Trash after a confirmation. 1Cleaner is free, with no ads, no account and no tracking; scans run on your Mac, and it goes online only when you check for updates. It is a direct download (DMG) for macOS 14 or later, Apple Silicon and Intel, signed with Developer ID and notarized by Apple. It is not in the Mac App Store, because the App Store sandbox would block access to ~/Library/Developer and Xcode's simulators.
Xcode disk space: FAQ
How do I clear Xcode DerivedData from the command line?
Quit Xcode and run rm -rf ~/Library/Developer/Xcode/DerivedData. With a custom location from Xcode's Locations settings, use that path. The command deletes immediately, without the Trash.
Is it safe to delete Xcode DerivedData?
Yes. It holds build products, indexes and logs that Xcode creates again. The next build and indexing of each project take longer, and Swift packages may be fetched again.
Is Clean Build Folder the same as deleting DerivedData?
No. Clean Build Folder removes the build products of the open project. Deleting DerivedData removes the build data, indexes and logs of every project at once.
Can I delete Xcode archives?
Only ones you will never need. Archives contain the dSYM files that make crash reports of a shipped build readable. Keep the archives of every version users still run.
Why does Xcode still take space after I delete it?
Deleting Xcode.app leaves ~/Library/Developer, Xcode's caches and the simulator runtimes behind. Delete the runtimes with xcrun simctl before you remove Xcode. If you still support apps you shipped, move ~/Library/Developer/Xcode/Archives to another disk first: it holds their dSYMs. Then remove ~/Library/Developer/Xcode and ~/Library/Developer/CoreSimulator if you no longer develop for Apple platforms.
See every Xcode leftover in one list.
See all 1Cleaner for Mac features
Commands checked against xcrun simctl help with Xcode 27.0 on macOS 26, October 20, 2026. Product facts: 1Cleaner for Mac 1.3.2. Mac, macOS and Xcode are trademarks of Apple Inc.