Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 575
Rajavanya Subramaniyan Avatar asked Feb 02 '13 13:02

Rajavanya Subramaniyan


2 Answers

This is explained in User 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

like image 177
Max MacLeod Avatar answered Oct 05 '22 18:10

Max MacLeod


  1. Clean is slower, because it deletes file by file, not whole folder
  2. After deleting DerivedData folder you'll get some slowdown, because XCode has to recreate indexes for your sources.
  3. There is 'Clean Build Folder...' command (Option-Cmd-Shift-K, or select Product menu and press Option button). It removes folders not files, so it can be faster for you.
like image 26
Vitaly S. Avatar answered Oct 05 '22 17:10

Vitaly S.