{"id":1168,"date":"2014-12-27T14:26:40","date_gmt":"2014-12-27T20:26:40","guid":{"rendered":"http:\/\/dev.iachieved.it\/iachievedit\/?p=1168"},"modified":"2015-12-13T09:56:44","modified_gmt":"2015-12-13T15:56:44","slug":"cleaning-out-deriveddata","status":"publish","type":"post","link":"https:\/\/dev.iachieved.it\/iachievedit\/cleaning-out-deriveddata\/","title":{"rendered":"Cleaning out DerivedData"},"content":{"rendered":"<p>Did you ever wonder what Xcode was doing when the <i>activity viewer<\/i> (bet you didn&#8217;t know it was called that) area says &#8220;Indexing | Processing files&#8221;?<\/p>\n<p><a href=\"http:\/\/dev.iachieved.it\/iachievedit\/wp-content\/uploads\/2014\/12\/tut_activity_viewer.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/dev.iachieved.it\/iachievedit\/wp-content\/uploads\/2014\/12\/tut_activity_viewer.png\" alt=\"tut_activity_viewer\" width=\"525\" height=\"36\" class=\"alignnone size-full wp-image-1173\" \/><\/a><\/p>\n<p>Well, other than the obvious (it&#8217;s indexing), it&#8217;s also filling up your hard drive with what it refers to as <i>derived data<\/i>.  This derived data contains all manner of information and assets associated with the project such as intermediate builds, precompiled objects, indexes (metadata about the project), etc.  All this information takes up space; a simple project with nothing more than a single view controller generated 15 megabytes of derived data, over 50 times the amount of space for the project folder itself!  <\/p>\n<p>If you&#8217;re like me you create and forget about iOS projects frequently (perhaps you&#8217;re blogging or you just like creating applications to learn new techniques or are following along online tutorials).  One can easily lose track of how much wasted space of derived data from old projects is sitting out there.  <\/p>\n<p>Fortunately it&#8217;s easy to get rid of and clean up.  Simply go to your Xcode <code>DerivedData<\/code> folder and delete everything in it:<\/p>\n<pre class=\"crayon:false\">\r\ncd ~\/Library\/Developer\/Xcode\/DerivedData\r\nrm -rf *\r\n<\/pre>\n<p>Now this <i>will<\/i> trigger a reindexing on your projects, but only when you reopen them.  I suppose I&#8217;m a packrat; my <code>DerivedData<\/code> folder had grown to 16 gigabytes, mostly from old projects.<\/p>\n<p>There may be other <code>DerivedData<\/code> folders lurking on your disk if you&#8217;ve used <i>relative<\/i> derived data folders in the past for your projects (that is, the <code>DerivedData<\/code> folder hangs out in your project folder rather than a central location in <code>~\/Library\/Developer\/Xcode<\/code>).  You can find and delete them with something like this:<\/p>\n<pre class=\"crayon:false\">\r\ncd ~\/projects\r\nfind . -name 'DerivedData' | xargs rm -rf\r\n<\/pre>\n<p>I keep all of my Xcode projects in a folder called <code>projects<\/code>.  If you keep yours in <code>Documents<\/code> or some other location, change to that directory first before searching for <code>DerivedData<\/code> with <code>find<\/code>.<\/p>\n<p>As always, take care when using <code>xargs rm -rf<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Did you ever wonder what Xcode was doing when the activity viewer (bet you didn&#8217;t know it was called that) area says &#8220;Indexing | Processing files&#8221;? Well, other than the obvious (it&#8217;s indexing), it&#8217;s also filling up your hard drive with what it refers to as derived data. This derived data contains all manner of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1168","post","type-post","status-publish","format-standard","hentry","category-xcodetips"],"_links":{"self":[{"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/posts\/1168"}],"collection":[{"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/comments?post=1168"}],"version-history":[{"count":8,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/posts\/1168\/revisions"}],"predecessor-version":[{"id":2148,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/posts\/1168\/revisions\/2148"}],"wp:attachment":[{"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/media?parent=1168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/categories?post=1168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.iachieved.it\/iachievedit\/wp-json\/wp\/v2\/tags?post=1168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}