94

I'd like to remove old (replaceable?) data and DerivedData contents seem a likely candidate. Since it's name DerivedData, I assume that it's info that, if missing, would be generated during a build phase and if present, is used during that same phase. It seems logical then that I could delete any old project data without fear and if I should ever build that old project, the first time through would take longer than normal sine it has to recreate all this derived data.

Am I mistaken here?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
soob
  • 1,085
  • 1
  • 7
  • 9
  • 8
    Be VERY AWARE that as Joshua explains, that bloody folder contains **"dSYM data for later debugging. ... not delete if you want to be able to debug deployed versions of your application"** – Fattie Oct 11 '11 at 12:48
  • Perhaps I should use every SO markup trick in addition to emphasis to call that point out in my answer. :-D Block-quoted-star-slash-commented-code-bold-italic-bulleted-list, etc. – Joshua Nozzi Oct 11 '11 at 14:03
  • 18
    @JoeBlow actually, as Joshua explains, it's the **Archives** directory which contains "dSYM data for later debugging". The **Archives** directory is a _sibling_ of the **DerivedData** directory, which means it's at the same level, below `~/Library/Developer/Xcode`, as **DerivedData**, so "that bloody folder" (DerivedData) does **NOT** contain the dSYM data and it's contents can be safely deleted. – mluisbrown Jun 05 '13 at 11:41
  • 4
    Whenever I release a new version, I copy the .xcarchive from Xcode into my git repo and keep it under version control - this is a good way of always being able to get old .dSYM's without depending on a particular machine's Xcode directories. – Bill Mar 27 '15 at 18:58

3 Answers3

127

The Derived Data folder contains all the intermediate build information, debug- and release-built targets, as well as your project's index. It's helpful to delete the derived data when you have odd index problems (code completion not working right, constant re-indexing, or even just a slow project). Deleting the entire folder nukes this information for all projects Xcode 4 knows about.

The Archives folder (a sibling of Derived Data) contains the archived form of your targets. That is, a release build as well as dSYM data for later debugging. This you should not delete if you want to be able to debug deployed versions of your application.

You can nuke the derived data for a given project by opening the Organizer window and selecting the Projects tab. Select the desired project and click the Delete button next to the Derived Data path. This is more of a "surgical strike" for problem projects.

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135
  • Any idea if you can remove the DerivedData folder via the command line? – asgoth Oct 02 '13 at 08:50
  • 1
    Sure. Go to the command line and type "man rm" - go nuts. :-) – Joshua Nozzi Oct 02 '13 at 17:40
  • 9
    Sigh. I know `rm`. I wanted to find a way to resolve the folder connected with the project, e.g. `~/Library/Developer/Xcode/DerivedData/MyProject-hghjhjhkjh/`. The easiest way i found is to set the DerivedData folder relative to the project folder, via XCode preferences. – asgoth Oct 02 '13 at 18:21
  • It depends on your project and/or workspace settings. Both levels have various options for using fixed, shared, relative, etc. paths. It's best to pose this as a separate question as it's far too much for comments and a bit much to tack on to this answer. – Joshua Nozzi Nov 22 '14 at 15:50
  • @JoshuaNozzi: So If i delete the derived data folder, does it effect to my app??? When my app is in simulator but not running from code and if i delete and then run again from code, then will it cause any issue? – Manthan Jul 30 '15 at 06:17
  • 4
    Just a quick note: In **XCode 6.x**, `projects` are in their own window (not the Organizer). – Olie Sep 12 '15 at 03:25
  • @Manthan I'm not sure - create a test project and see. – Joshua Nozzi Sep 15 '15 at 19:10
  • 1
    I like your military jargon XD – Josh Aug 25 '16 at 10:43
  • 1
    FWIW a lot of new distribution tools (AppCenter, HockeyApp, Crashlytics, etc) ask you to hand over the dSYM files so you don't have to store them yourself. – mfaani Apr 23 '20 at 14:26
43

The content of 'Derived Data' is generated during Build-time. You can delete it safely. Follow below steps for deleting 'Derived Data' :

  1. Select Xcode -> Preferences..

Step 1

  1. This will open pop-up window. Select 'Locations' tab. In Locations sub-tab you can see 'Derived Data' Click on arrow icon next to path.

Step 2

  1. This will open-up folder containing 'Derived Data' Right click and Delete folder.

Step 3

Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
32

Yes those data are generated during the build time and you can delete them if you want, its not a issue.

It will be recreated when you build again.

gcamp
  • 14,622
  • 4
  • 54
  • 85
amrit_neo
  • 1,759
  • 4
  • 19
  • 39