388

The projects page seems to be disappeared from Xcode 8. I used this page for deleting the derived data.

Any idea how can I delete derived data from within Xcode 8?

Tamás Sengel
  • 55,884
  • 29
  • 169
  • 223
Antoine
  • 23,526
  • 11
  • 88
  • 94

18 Answers18

463

(Working in Xcode 11, 12, 13 and 14)

You can go to File > Workspace Settings if you are in a workspace environment or File > Project Settings for a regular project environment.

Then click over the little grey arrow under Derived data section and select your project folder to delete it.

Click that button

Bisca
  • 6,380
  • 2
  • 19
  • 32
252

The simplest and fastest way is the following (if you have not changed the defaults folder for DerivedData).

Open terminal and past the following:

rm -rf ~/Library/Developer/Xcode/DerivedData
zirinisp
  • 9,971
  • 5
  • 32
  • 38
  • 3
    As an additional beneficial option, you can also delete all app builds on all of your simulators by running the following (once you've quit running any simulators) `xcrun simctl erase all`. This doesn't clear the same stuff as derivate data obviously, but if you're trying to free up space this is another great option, as both take up quite a bit for old app builds. – Albert Renshaw Mar 06 '19 at 07:19
  • 1
    You could also make this a terminal shortcut. See [here](https://superuser.com/questions/375092/how-to-set-up-a-shortcut-to-a-directory-in-mac-os-x-terminal/375126#375126) – mfaani Apr 09 '19 at 14:45
  • But this also deletes the folder itself! Is that not a problem? –  Jun 12 '20 at 00:15
166

Many different solutions for this problem. Most of them work as well. Another shortcut seems to be added as well:

Shift + alt + command ⌘ + K

Will ask you to:

Are you sure you want to clean the build folder for “MyProject”?

This will delete all of the products and intermediate files in the build folder.

In most cases this would be enough to solve your problems.

UPDATE

As of Xcode 9 you'll be able to access the Derived Data folder by navigating to

File -> Project Settings

or if you use a Workspace:

File -> Workspace Settings

And press the arrow behind the path: enter image description here

Ahmad F
  • 30,560
  • 17
  • 97
  • 143
Antoine
  • 23,526
  • 11
  • 88
  • 94
92

In Xcode 8, all the derived data is automatically cleaned. If you want to do it by hand, go to Locations tab from the Preferences, locate project's derived data folder, and delete files related to the project.

In macOS 10.12 and later, Xcode cleans up stale derived data, precompiled headers, and module caches. (23282174)

Xcode 8.0 Release Notes

Credits to @charmingToad

But from what I observed, the same behaviour is typical when using Xcode 8 on OS X 10.11.5/6

nsinvocation
  • 7,559
  • 3
  • 41
  • 46
  • 6
    Do you have a reference to where this is specified? – ABeanSits Aug 12 '16 at 01:06
  • 3
    is there an official source that confirm this that it is automatically cleaned? – user1007522 Sep 14 '16 at 14:26
  • 31
    Automatically cleaned when? – dmzza Sep 17 '16 at 08:09
  • deleting this and cleaning your project fixed my problem in Xcode 8 when every project got stuck on 'compiling asset catalogs' – Reece Sep 19 '16 at 14:14
  • 5
    Xcode 8 release notes say "In macOS 10.12 and later, Xcode cleans up stale derived data, precompiled headers, and module caches." I'm not sure how often derived data is considered "stale" though... https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html – charmingToad Sep 21 '16 at 18:50
  • 2
    @dmzza not sure to be honest, Apple doesn't explain when it does it. – nsinvocation Oct 06 '16 at 08:31
  • I wouldn't rely on this (I got a compiler still looking for a deleted file without any reference to it in the project). So manually wiping it still can be a very good idea. – Alper Jun 06 '17 at 11:28
  • I can confirm i just had to delete Derived Data to get a new framework added to the Firebase module. – okhobb Oct 27 '17 at 23:19
71

Go to Xcode -> Project Settings

enter image description here

You can find the way to go to derived Data

enter image description here

Nazik
  • 8,696
  • 27
  • 77
  • 123
60

Method 1:

  • Close Xcode
  • Open Terminal and enter this command

    rm -rf ~/Library/Developer/Xcode/DerivedData
    

Method 2:

  • Click on Xcode menu
  • Go to Preference
  • Select Locations (as shown in image)
  • Click on the arrow below the Derived Data (as shown in image).

It will bring you to the location of derived data and you can just delete it manually.

enter image description here

Ghulam Rasool
  • 3,996
  • 2
  • 27
  • 40
  • 1
    Note that if you get an error saying a subfolder of the derived data directory could not be deleted because it's not empty (even when you run with `-rf`), you need to quit XCode and your simulator and then try again to clear the derived data – Eric Wiener May 24 '20 at 12:49
53

Manual removal of derived data

If you want to remove derived data manually just run:

rm -rf ~/Library/Developer/Xcode/DerivedData

If you want to free up more disk space there's a few other directories you might want to clear out as well though.

Automatic removal of Xcode generated files

I have created a Bash script for removing all kinds of files generated by Xcode. Removing DerivedData content can be done by running:

./xcode-clean.sh -d

More info at https://github.com/niklasberglund/xcode-clean.sh

Niklas Berglund
  • 3,563
  • 4
  • 32
  • 32
22

In your terminal :

rm -rf ~/Library/Developer/Xcode/DerivedData
Xys
  • 8,486
  • 2
  • 38
  • 56
12

In the Latest Xcode version 12+ Follow the below steps, I found here https://handyopinion.com/solution-failed-to-load-info-plist-from-bundle-at-path-in-xcode/

1.

enter image description here

2.

enter image description here

It will navigate to the Derived Data folder then you can remove the content of the folder.

Asad Ali Choudhry
  • 4,985
  • 4
  • 31
  • 36
11

Select Xcode and Follow 4 steps that highlighted in photo and remove derived data then restart your project.enter image description here

Hemant Solanki
  • 894
  • 10
  • 24
10

Another way to go to your derived data folder is by right click on your App under "Products" folder in xcode and click "Show in Finder".

Ansyar Hafid
  • 229
  • 3
  • 5
  • This won't work if you've set your product to a different path -- for example, I set mine to build straight to ~/Applications, but keep the derived data in the default location. – SilverWolf Jul 11 '18 at 17:48
6

Go to the root of the project using terminal and then paste the below mentioned line

rm -rf ~/Library/Developer/Xcode/DerivedData

Once it is executed, you can verify by going to Xcode > Preference > Locations -> Tap arrow shows ["DeriveData"] end point.

  • 2
    You don't need to go to the root of the project since the command uses an absolute path. – Xys Mar 18 '21 at 10:04
3

Steps For Delete DerivedData:

  1. Open Finder
  2. From menu click on Go > Go to Folder
  3. Enter ~/Library/Developer/Xcode/DerivedData in textfield
  4. Click on Go button
  5. You will see the folders of your Xcode projects
  6. Delete the folders of projects, which you don't need.
Pramesh Bhalala
  • 273
  • 1
  • 3
  • 9
Siddhesh Bhide
  • 374
  • 5
  • 9
1

I've created a bash command. Configure it with 3 simple steps. then in the terminal just type cleandd https://github.com/Salarsoleimani/Usefulscripts

Salar Soleimani
  • 227
  • 1
  • 3
  • 9
0

It may differ between versions of xcodes. Best approach is to go xcode preference page and from tab "Locations", directly open "Derived Data" directory.

Alireza
  • 49
  • 7
0

DevCleaner on the Mac App Store did the trick for me!

https://apps.apple.com/gb/app/devcleaner-for-xcode/id1388020431?mt=12

Also looks useful for removing other cruft due to Xcode. Remember this is a 3rd party app so usual trust warnings apply.

vin047
  • 260
  • 3
  • 12
0

To delete derived data in Xcode 8, follow below steps:

  1. Open Xcode 8 and go to the "Preferences" menu.
  2. Click on the "Locations" tab.
  3. Look for the "Derived Data" section and click on the small arrow icon next to the path.
  4. This will open the "DerivedData" folder in Finder.
  5. Quit Xcode 8 to avoid any conflicts.
  6. Select all the folders inside the "DerivedData" folder and move them to the trash.
  7. Empty the trash to permanently delete the derived data.
Ananta Prasad
  • 3,655
  • 3
  • 23
  • 35
-11

For Xcode Version 8.2 (8C38), you can remove the projects completely (project name in Xcode, programs, data, etc.) one by one by doing the following: [Note: the instructions are not for just remove the project names from the Welcome Window]

Launch the Xocde and wait until the Welcome window is displayed. The projects will be shown on the right hand side (see below) Xcode Welcome Window

Right click the project you want to remove completely and a pop window [Show in Folder] jumps out; selec it to find out where is the project in the [Finder] (see below) Find the project folder

Right click the project folder in the Finder to find it’s path through [Get Info]; use path in the Info window to go to the parent folder, and go to there[Locate the project folder path] (see below)

Right click the Project Folder (e.g. DemoProject01) and Porject file (DemoProject01.xcodeproj) and select [Move to Trash] ; you will see that (a) the folder in finder is removed AND (b) the Project in the Xcode Welcome Window’s Project List is removed.

JubiAudio
  • 115
  • 1
  • 5