CategoriesMac

Delete Xcode Derived Data from Mac Spotlight

Sometimes Xcode can enter an unusual or unstable state, causing various development hiccups or errors that seem hard to fix. In many cases, the most effective remedy is to clear the derived data folder, which stores cached build files and indexes. Removing this data forces Xcode to rebuild everything from scratch, often resolving strange bugs or slowdowns.

Since the need to clear derived data can arise frequently depending on your Xcode version and project, having a quick and easy way to do it is invaluable. This handy tool lets you open an app directly from Spotlight that instantly clears your derived data, saving you time and hassle. With just a few keystrokes, you can reset your build cache and get Xcode running smoothly again without digging through folders manually.

Download and extract the .zip anywhere on your Mac. I recommend putting the app in your Applications folder or I found it useful for placing it in my iCloud documents folder. So the app would be synced over my Macs.

Download

The app has 2 versions, the first one stays open with a list of all the deleted files then waits for you to click Quit. The autoclose version will just close when it’s done cleaning.

Extract the .app in your applications folder. CMD+Space and type “dele…”. The app should instantly popup and enter to start the cleaning. The app will show a list of all files being deleted ending with done when all your derived data is removed. Simply click Quit to close the screen, or download the autoClose version that will automatically close when the derived folder is cleaned. The deleted files will skip the trash and will be permanently deleted.

The app will show the list of files it has deleted and

note: This app will simply run “rm -rf” on the documents folder (~/Library/Developer/Xcode/DerivedData), if you configured a different location in Xcode, this script will not work and the correct setting is shown in the image below.

Leave a Reply

Your email address will not be published. Required fields are marked *