DevCleaner is a tool that allows you to reclaim tens of gigabytes of your storage used for various Xcode caches.
Xcode could store massive amount of data in ~/Developer folder. Most of those are cached files & symbols are not reclaimed over time and could consume a large amount of your storage, which is especially important if you have relatively small SSD drive.
DevCleaner gives you an easy way to inspect auto-generated files and clean them if necessary. It could also remind you about scan after a while.
Please note that this application is relying on internal folder structures and undocumented features. It could stop working with newer versions of Xcode! I tried to make sure this application is safe, but if you want to be sure, please make backup before use it.
Currently it is tested with Xcode 15.x.
In case of any issues, please first consult FAQ section at the end of this manual!
What it cleans?
Device Support
In order to debug iOS/tvOS/iPadOS/watchOS/macOS devices, Xcode first needs to download debug symbols appropriate to version of OS that we currently use on a device. You may noticed that when connecting a new or updated device when having Xcode opened.
Those symbols are needed for each of your device and for each of *OS version, after a new update, even a minor one, Xcode needs a new set of symbols. Unfortunately, old symbols are not removed and each of them take 2-5GB of disk space. As you can imagine, they can start to sum up pretty quickly, usually there's 10s of smaller updates in less than a year for each OS.
DevCleaner helps cleaning those symbols, selecting older ones by default, keeping only those most recent ones. Of course final decision is yours.
Archives
As you write software and making a test or release builds, you probably use Archive option from Xcode. Sometimes you would end-up with a massive amount of archives, from which most of them are useful after a while. They can take various size, from just tens of MBs up to GBs.
Some archives are more useful than others though. Remember that if you submit your binary to the AppStore and release it, you have access to crashlogs from archives, therefore archives are not selected by default. Archives that was submitted/deployed successfully are marked with ✅ symbol, those that failed with ❌. Archives that weren't submitted nor deployed are not marked by any symbol, they are usually safe to clean.
Derived Data
When you develop your app, Xcode caches your symbols, dependencies, logs, text - all to develop fast and to keep code completion working. Unfortunately this data tend to take a lot of space, especially for big projects. Also, they're not deleted automatically. This may be especially problematic if you open a lot of various projects.
Removing derived data is not harmful as Xcode can recreate them when you open project again. Although it's not recommended for projects that you work on often. For this reason nothing is selected by default.
Documentation Cache
Modern Xcodes are caching documentation that is accessed via the web. Unfortunately older caches are not cleaned up by Xcode and significant
amount of space may be wasted due to that.
Removing all cache is not harmful but remember that your most current Xcode will regenerate it anyway if it'll have a chance. It also could slow down access to documentation after cleaning them.
Old Simulator & Device Logs
Each version of Xcode appears to have a new version of database that holds logs from devices & simulators. Those databases are migrated with content of the previous ones. If you use Xcode for a long time, it would accumulate to significant amount of unused data.
It should be safe to check this option, by default all old databses are selected except most recent version of Xcode.
If you have multiple (older) Xcode installations, you probably should deselect those versions too.
Old Documentation Downloads
Recent versions of Xcode are using online help. But if you used Xcode in the past, you may still have documentation downloaded locally to your computer. It could take a lot of space and currently there is no use for it.
Main Window
This is the main interface of the application, you select here what you want to clean and performing cleaning itself. You can also share or tip me if you want 😎
Items to Clean
Select items you want to clean, you can choose details if you click on arrows. You can see how much space you can recover and how much you selected. Usually you don't want to clean everything, as most probably it will be restored by Xcode on next time you run your current project anyway, and it will take some time. Consult manual to get information what is the purpose of those items.
Help Button
Displays this help.
Tip Button
If you think this app helped you somehow, you can consider a small tip, or just share it. I would greatly appreciate it and continue development.
Clean Button
Click here if you're sure you have everything selected as you wish. If you have "Dry mode" enabled, it won't actually clean anything and a small label will be displayed nearby.
Preferences
Notifications
You can set notifications to remind you about scans. Available periods: 2 weeks, 1 month, 2 months.
Debug
You can set "Dry Run" to check what exactly will be performed, without actually deleting any files.
Derived Data & Archives Locations
If you store those data in a custom location, you can set it here. It should be set to same folders as in "Locations" tab in Xcode "Preferences" window.
Application Menu
Preferences...
Opens preferences window.
Show Log Files...
In case of problems, this will show application log files folder. If you ever will have any issues with the application, those files would help finding the cause. You may be asked to send them.
Install Command Line Tool...
This will open instructions how to install command line tool.
File Menu
Rescan...
Rescans all files manually.
Close
Closes active window.
Command Line Tool
You'll find instructions how to install command here: Command Line Tool
Usage
After installing tool, type dev-cleaner in your preferred terminal. It will show short instructions how to use it:
DevCleaner 2.8.0
OVERVIEW: Reclaims storage that Xcode stores in caches and old files
USAGE: dev-cleaner [options]
OPTIONS:
info
Show all items available to clean.
clean
Perform cleaning of given items. Available options: all,device-support,archives,derived-data,docs-cache,previews,old-logs,old-documentation. If you want to clean all, pass "all" or nothing
--help
Prints this message
Please note that command line tool doesn't allow to select specific items, it's designed to run mostly in maintanance scripts or CI machines.
FAQ
Q: Why I can't see disk space that I freed in Finder or System Info?
Since APFS, hard disk free space is not so easy to calculate anymore (due to snapshots, clones and other features of new filesystem), hence small delay in refreshing it. Final space freed could also be different due to those features. Also, make sure you haven't enabled "Dry Mode".
Q: How can I support development of the app?
You can give me a tip, click on "🤓 Tip me..." button.
Alteratively, I would also love if you share it with your friends, follow me or Twitter or Mastodon, or make a nice review!