DerivedData is where Xcode keeps everything it generates while building your projects. It is safe to delete, Xcode recreates it on the next build, and it is one of the first places to look when a Mac used for iOS or macOS development runs low on space.
Every time you build, Xcode writes compiled object files, build products, logs, module caches and the index that powers code completion and search into DerivedData. Each project gets its own subfolder, named after the project followed by a string of random letters, such as MyApp-bxhqwkcpzrdmtfa.
Xcode doesn't remove the folders of projects you no longer open, so they pile up. A project you deleted months ago can still have its full build output sitting here.
The default location is:
~/Library/Developer/Xcode/DerivedData
To confirm the location Xcode is using, open Xcode › Settings › Locations. The DerivedData row shows the path, and the small arrow next to it opens the folder in Finder. If it is set to Relative or a custom path, your DerivedData may live inside each project folder instead.
In Finder, choose Go › Go to Folder (Shift-Command-G) and paste the path. The Library folder is hidden by default, but Go to Folder still opens it.
In Terminal, the total:
du -sh ~/Library/Developer/Xcode/DerivedData
Each project's folder, largest first:
du -sh ~/Library/Developer/Xcode/DerivedData/* | sort -hr | head -20
In Finder, select the DerivedData folder and choose File › Get Info (Command-I). The size can take a moment to calculate.
There is no typical size. It depends on how many projects you have built, how large they are and how many Swift packages they pull in, so measure yours rather than trusting a number from a forum post.
In Finder, open the DerivedData folder, select everything inside it, move it to the Trash and empty the Trash. To clear a single project, trash only that project's subfolder.
In Terminal:
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf deletes immediately and skips the Trash, so check the path before pressing Return. Xcode recreates the folder the next time it builds.
For a lighter clean of one project, Product › Clean Build Folder (Shift-Command-K) in Xcode removes that project's build products but leaves the rest of DerivedData alone.
~/Library/Developer/Xcode/Archives holds the builds you archived for TestFlight or the App Store, with the debug symbols you need to read crash reports from those versions. Keep the archives for anything you have shipped.~/Library/Developer/CoreSimulator holds simulator devices and their data. Remove simulator runtimes in Xcode › Settings › Platforms, and remove devices for runtimes you no longer have with xcrun simctl delete unavailable.~/Library/Developer/Xcode/iOS DeviceSupport holds symbol files copied from physical devices you have connected. Xcode copies them again the next time you connect that device, which takes a few minutes.DerivedData fills up again as you build. Deleting it is not a one-time fix; it is routine maintenance.
The free scan in SymbolSweep measures ~/Library/Developer/Xcode/DerivedData and any folder named DerivedData inside your project folders, and lists them in the REBUILD tier: safe to delete, but the next build takes longer.
xcodebuild command is running, the DerivedData row is marked as building and is not deleted.Scanning is free and never deletes anything. Deleting needs a one-time $12 license for one Mac. Requires macOS 13 or later on Apple silicon. See how it works.
Yes. It contains only files Xcode generates from your project. Quit Xcode first, then delete it. The cost is a slower first build and a re-index.
No. Source files, schemes, signing settings and breakpoints live in your project folder, not in DerivedData.
There is no need to clear it on a schedule. Clear it when you are short on disk space, or when Xcode shows stale errors or a broken index that a clean build doesn't fix.
Check Archives, CoreSimulator and iOS DeviceSupport in ~/Library/Developer. They are separate folders and are not removed with DerivedData.