How can derived data be deleted in Xcode 8?

How can derived data be deleted from a project on Xcode 8?

Replies

I was wondering too. It isn't the same as Xcode 7 (at least not for me) - there is no "Projects" item on the Windows menu, which listed the projects and had a "Delete" button next to Derived Data when you selected a project. I ended up just going to ~/Library/Developer/Xcode/DerivedData and deleting the folder that starts with the Project name.

shift-alt-command-k ... isn't that what you're referring to?

It's under the product menu. Bring that down, then press the Alt key and you'll see the extras.

That's the 'option-clean build folder' item that's always been there, and different.

Yep, the 'Window/Projects' menu choice is missing, so it's all back to manual now.


What is still there is Prefs/Locations>Derived Data, where you can tap on the tiny arrow at the end of the derived data path to open it in the Finder, however. Then you have to figure out which one you want to blast.

I'm saying that an option-clean deletes the folder (all targets), not just the contents (derived data) for the selected target.


When a simple clean/delete derived data seems ineffective, an option-clean build folder will always use the bigger hammer. I never bother with just a clean, especially when building for the store.


I see your point, tho, and wonder why they changed the menus, unless it was to simplify, and/or make room for a new selection..

Very strange change from Apple and buggy!

I delete "Derived Data" and build again, some files (generated by CoreData) are created. These files have been deleted days ago and appear here at every build...

An easy 'Delete Derived Data' solution is sorely missed by our team. Please bring it back.

Add `rm -rf ~/Library/Developer/Xcode/DerivedData` as an alias in your terminal sessions (i.e. .bashrc, .profile, .bash_profile).

This is a bit of a **** & pave but better that unexpected errors on build. You could write something more clever that uses the Xcode target to determine which subdirectory within `DerivedData` to delete.

An easy 'Delete Derived Data' solution is sorely missed by our team. Please bring it back.

The best way to get this feedback to the folks who can effect change is to file a bug about it.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Forget about "Derived Data". There was also a button to delete all snapshots for each project.

This is a major bummer.


I filed a bug report and I recommend every one else does, too.

As a work around, you can make an Automater workflow. Trick I learned on a gig once...


For instance,


1. Open Automater in /Applications.

2. Create a new service

3. In work flow actions, goto Utilities and drag Run Shell Script to the right panel.

4. Change Service receives selected "text" to "no input"

5. Change "any application" to Other... select Xcode in Finder

6. In the shell script add the command that will delete the derived data. Something like... ( or maybe less dangerous )

rm -rf ~/Library/Developer/Xcode/DerivedData/*


7. Goto the the file menu and choose save. The service will be saved in your ~/Library/services directory.

8. Run Xcode.

9. Select the Xcode menu goto Services. You should see your sevice. eg. DeleteDerivedData

10. Run service. Derived data deleted via Xcode.

Filed a bug no. 28364380

Won't this clear all derived data of all projects?