Is Xcode DerivedData Safe to Delete? What Happens and How to Clean It
Yes—Xcode's DerivedData folder is safe to delete. Xcode automatically regenerates everything inside it the next time you open and build a project. The only trade-off is that your next build and index for each project will start from scratch and take longer. On one developer Mac we measured, ~/Library/Developer/Xcode/DerivedData occupied 15.3 GB (and adjacent Xcode storage was even larger: 24.1 GB…
Xcode's DerivedData folder can be safely deleted without affecting your source code or Git history. Deleting it will cause Xcode to regenerate all contents the next time you open and build a project, which may take longer due to the initial regeneration. The amount of space consumed by DerivedData varies depending on the number of projects and iOS SDKs you work with.
For example, on one developer's Mac, DerivedData occupied 15.3 GB, while Xcode storage for iOS DeviceSupport and CoreSimulator/Devices was 24.1 GB and 43.0 GB, respectively.
When deleting DerivedData, always quit Xcode first to avoid build issues or stale editor warnings. You can remove DerivedData manually via Finder or Terminal, or use a third-party tool like CleanBit, which provides options to clean Xcode storage selectively. CleanBit separates Xcode folders based on their risk level, such as rebuildable DerivedData, older DeviceSupport versions, SwiftUI Preview data, and caches from shut-down Simulator devices.
It is recommended to clear DerivedData once every few weeks or whenever you finish a major project, upgrade Xcode, or encounter build glitches.
Deleting DerivedData does not break Swift Package Manager dependencies, as the package list is defined in Package.swift or the .xcodeproj file, and Xcode will automatically re-resolve and rebuild packages when you open the project again. However, if you use AI coding agents or JavaScript toolchains, there might be additional storage that needs cleaning, as outlined in separate guides.
Rewritten by urgent.news; may contain errors — check the original.