Difference between cleaning and deleting the DerivedData folder
Asked Answered
U

2

9

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.

Uncommon answered 2/2, 2013 at 13:15 Comment(0)
J
9

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

Jeaz answered 5/2, 2013 at 11:17 Comment(0)
K
1
  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.
Killick answered 5/2, 2013 at 10:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.