How to delete derived data in Xcode

Xcode stores intermediate build results, generated indexes and other built results in form of derived data.

It can grows to 5-10 GBs or even more depending on how complex your projects are. Sometimes, derived data can result into strange Xcode errors. That's why it is highly recommendable to delete the derived data. Also, note here that it is totally alright to delete the derived data (there are few consequences described in next paragraph). You won’t lose any your app data if you delete the derived data. Moreover, who doesn't enjoys some more storage.

Deleting derived data can have some consequences, as if you are using Swift package manager, all the cache in your derived data will be gone, that could be not desirable.

So today, we are going to learn about two ways we can delete the Xcode derived data.

Using Mac Finder

a) In Mac Finder, click "Go" in tab bar and hold your option key to see the “Library" Option.

b)  Go to the Xcode -> Location, Go to derived data and click the arrow which will take you to the derived data folder.

Go to Developer -> Xcode -> Derived Data and feel free to delete the contents of the derived data folder.

2. Using Terminal

Paste and run the following command in the terminal and you are good to go.

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

What's Next?

Now that you have learned how to delete derived data from Xcode project, you might also like to know about how to add custom theme to your Xcode. Till then,

Eat. Sleep. SwiftAnytime. Repeat.

You've successfully subscribed to Swift Anytime
Great! Next, complete checkout to get full access to all premium content.
Error! Could not sign up. invalid link.
Welcome back! You've successfully signed in.
Error! Could not sign in. Please try again.
Success! Your account is fully activated, you now have access to all content.
Error! Stripe checkout failed.
Success! Your billing info is updated.
Error! Billing info update failed.