
The Developer’s Catch-22: Your Mac is Full, and Cleanup Tools Won’t Run. Now What?
May 28, 2025
Proceed with caution and make sure your apps are backed up.
The Developer’s Catch-22: Your Mac is Full, and Cleanup Tools Won’t Run. Now What?
You’re deep in a coding session, on the verge of a breakthrough. You hit “build,” and instead of the satisfying “Build Succeeded” message, your screen erupts in a cryptic storm of red errors. Failed to write info plist component
, Failed to launch AssetCatalogSimulatorAgent
, You can’t save the file...
. You check your code, but it’s perfect. The issue isn’t logical; it’s physical. The silent killer of developer productivity has struck: your hard drive is full.
This scenario is frustrating enough, but it quickly spirals into a developer’s worst nightmare—a true catch-22. You try to run the standard terminal commands to clean up Xcode’s caches, but are met with the ultimate rejection:
xcrun: error: couldn't create cache file... (errno=No space left on device)
Your Mac’s storage is so critically low that you don’t have enough space to run the very commands that would free it. You are, for all practical purposes, locked out of your own workshop. But don’t panic. There is a way out, and it starts with emergency triage.
Step 1: Emergency First Aid (No Special Tools Needed)
When commands fail, you must act manually. Forget the developer tools for a moment and think like any computer user trying to clear space. Your Xcode project must be closed for this.
- Empty the Trash: It’s the simplest solution and often overlooked. Right-click the Trash icon in your Dock and select “Empty Trash.”
- Raid Your Downloads Folder: This is the digital equivalent of cleaning out your garage. Open Finder, go to your Downloads folder, and sort by “Size.” You will almost certainly find gigabytes of old application installers (
.dmg
files), compressed folders (.zip
files), and forgotten videos. Delete them without mercy and empty the Trash again.
For many, these two actions are enough to create the tiny sliver of space needed for the next step.
Step 2: The Surgical Strike (The Command That Still Works)
Even when xcrun
fails, the more fundamental rm
(remove) command usually has enough overhead to run. We will aim it at the single biggest source of developer-related bloat: Xcode’s Derived Data.
Open the Terminal app and run this command:
Bash
rm -rf ~/Library/Developer/Xcode/DerivedData/
What is this doing? The DerivedData
folder is Xcode’s messy workbench. It’s filled with temporary files, indexes, and intermediate builds from every project you’ve ever worked on. It can easily swell to 50 GB or more. This command deletes the entire folder. It is 100% safe to do—your source code is untouched. Xcode will simply create a fresh, empty DerivedData
folder the next time it opens.
Running this one command can instantly reclaim a massive amount of space and is the key to breaking the catch-22.
Step 3: The Full System Cleanup (Now That You Can)
With breathing room restored, you can now run the proper cleanup tools that failed before.
- Erase Simulator Data: Now, the
xcrun
command should work. This resets all your iOS simulators to factory settings, clearing out old test apps and their data. Bashxcrun simctl erase all
- Clear Old Archives: This deletes old, packaged versions of your apps that you prepared for release. Bash
rm -rf ~/Library/Developer/Xcode/Archives/
Prevention: Don’t Let It Happen Again
Recovering from a full disk is stressful. Avoiding it is simple.
- Schedule a Cleanup: Set a recurring calendar event for the first of every month to run the three commands above. It takes less than a minute.
- Use the Storage Manager: Apple’s built-in tool is excellent for finding non-developer bloat. Regularly go to Apple Menu > About This Mac > Storage > Manage… to see what’s eating your space.
- Maintain a Buffer: Treat free space as a required resource, just like RAM. Always aim to have at least 15-20% of your disk free, or a bare minimum of 30-50 GB.
A full hard drive isn’t just an inconvenience; it’s a complete roadblock to development. By understanding the emergency steps and adopting a routine of proactive maintenance, you can ensure your most important tool—your Mac—is always ready for your next great idea.