iosxcodederiveddata

Difference between cleaning and deleting the DerivedData folder


What is the actual difference between both these actions?

I ask because I find cleaning (Cmd-Shift-K) a slow, time taking process, and deleting the whole DerivedData folder much more faster.

More Info

1) I have set my DerivedData folder to be in a relative folder to my project folder in the XCode preferences.

2) I usually deal with projects with only one target. Very rarely I have to deal with 2 or more targets.


Solution

  • This is explained in Use Your Loaf's article on Xcode 4 DerivedData and Cleaning the Build Directory.

    In Xcode 4 the Product > Clean menu option cleans up the build directory for all targets by deleting the app and dSYM files along with the precompiled headers.

    DerivedData on the other hand contains other stuff:

    Each workspace gets a unique set of symbol indexes, build products, window layouts, etc., otherwise referred to by Xcode as derived data.

    So, the answer if you want to really clean everything, is to use the new Xcode 4 Clean Build Folder action by selecting the Product menu whilst holding the Option key. That will also delete the DerivedData contents:

    enter image description here