How to "Delete derived data" in Xcode?

XcodeXcode6Ios Simulator

Xcode Problem Overview


In Xcode5 there is simple option to Delete derived data:

In organiser menu (cmd + shift + 2):

enter image description here

But with new interface of Xcode6 there is no similar options.

Is there any quick methods to delete this trough Xcode6 interface?

Or now I should remove this folders in system manually?

Xcode Solutions


Solution 1 - Xcode

Update again: in Xcode 12 go to Preferences -> Locations tab -> click the arrow by the DerivedData path to open it in Finder -> move DerivedData to the trash (Xcode will rebuild it)

Solution 2 - Xcode

exit xcode

In the Terminal application (I'm sure you have it open at all times ;^) type:

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

If xcode does not cooperate when you asked it politely to exit from file menu or via Command-Q shortcut due to some incessant popup craving for your attention in a pile of windows in a long forgotten space you could brute force the xcode eviction like so

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

Caveat: if you won't exit the xcode first you'd get lingering files (cutesy of HFS I suppose) and you'd have to use the Sheamus'es script. Feel free to share your experience with the newer (no longer experimental) macos fs in the comments below.

bash tip of the day: tab performs filename completion as you type paths

Tip of the year: consider procuring O'Reilly bash book[s] to save your time further. Disclaimer: I do not work for O'Reilly, never did. Just a happy customer.

Though in my recent experience with Xcode 10.2.1 Windows(Cmd)+Shift+k shortcut works just fine.

Solution 3 - Xcode

Pressing Cmd + Shift + 2 In Xcode 6 will present Devices, which is separated from Organizer. Instead you can go Window, then Organizer, then find your project in Projects to delete derived data. You may set a short key in Key Bindings for quick access to derived data.

enter image description here

Solution 4 - Xcode

At Xcode 7.2.1 you can now the following:

⌘⌥⇧K

Which is Command + Option + Shift + K

Alternatively you can select Product > (Hold Key) and select Clean Build Folder...

Edit: I also like to create an alias for one of @anton-tropashko's suggested shell commands:

alias nuke-dd='rm -rv ~/Library/Developer/Xcode/DerivedData'

Add this ^^ to your ~/.bash_profile or somewhere else that is sourced for each shell you start, then just type:

$ nuke-dd

Solution 5 - Xcode

The approach I'm using is to install the watchdog app (https://www.cerebralgardens.com/watchdog).

This app will automatically clear your derived data based on your preferences (e.g. when data exceeds a certain size, when xcode closes, daily at a certain time, manually or when a clean is detected).

EDIT:

For those who don't want to spend money, in Xcode 7 select the Windows menu and Project. You can then select your project and delete its derived data (see screenshot below). Note that if there is a blue dot next to your project it indicates that it is open. It is better to close your project before deleting the derived data.

Delete derived data

Solution 6 - Xcode

I suggest to install the plugin DerivedData Exterminator by Alcatraz to clean up in Xcode6/7.

Please see the deriveddata-exterminator on GitHub.

===== Update =====

In Xcode8:

Window -> Projects (sometimes Projects disappears,try it again, maybe a bug) Choose your project,then click the delete button.

Or using Alfred:

http://www.packal.org/workflow/xcode-cache-clean

just type xcl.

xcode-cache-clean

Solution 7 - Xcode

Xcode 7.3

Window -> Projects

Then Delete the Derived Data

Solution 8 - Xcode

You can use the command line. My shell script, works for Xcode 4, 5, and 6.

Sometimes, simply calling rm -rf on the Derived Data directory leaves a lingering file or two, but my script loops until all files are deleted.

Solution 9 - Xcode

rm -rf ~/Library/Developer/Xcode/DerivedData Then in terminal, type purgeallbuilds, and all subfolders of DerivedData are deleted.

Solution 10 - Xcode

Sometimes I have hit on Delete button on DerivedData in (Window -> Projects) but it doesn't work.

Then I solve it by click on this small icon enter image description here on the right of DerivedData path. It will navigate me to the DerivedData folder.
And in DerivedData, I remove DerivedData by Move To Trash and it removes successfully

Solution 11 - Xcode

You can delete derived data by clicking on the going into Xcode > Preferences. See the tutorial I found below.
https://www.youtube.com/watch?v=ueEMGXKDBAc

This image shows a screenshot from the video which will guide you the exact location in Xcode preferences.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionskywinderView Question on Stackoverflow
Solution 1 - Xcodek kView Answer on Stackoverflow
Solution 2 - XcodeAnton TropashkoView Answer on Stackoverflow
Solution 3 - Xcodevladof81View Answer on Stackoverflow
Solution 4 - XcodeAaronView Answer on Stackoverflow
Solution 5 - XcodeReefwingView Answer on Stackoverflow
Solution 6 - XcodehstdtView Answer on Stackoverflow
Solution 7 - XcodekavehmbView Answer on Stackoverflow
Solution 8 - XcodeSheamusView Answer on Stackoverflow
Solution 9 - XcodeAshView Answer on Stackoverflow
Solution 10 - XcodeLinhView Answer on Stackoverflow
Solution 11 - XcodeshmathurView Answer on Stackoverflow