There are some times that we have to delete the derived data that Xcode produces.
There are many ways to achieve this. In this article we will add a zsh command to do it, so every time you want to delete the derived data all you have to do is to go to the terminal and type the command.
If you prefer bash instead, please check this article: http://trikalabs.com/delete-derived-data-bash-command/
Let’s start by open/creating the zshrc file.
Open terminal and type
1 |
touch ~/.zshrc |
This will create a new file. Let’s open it:
1 |
open ~/.zshrc |
The file is currently empty let’s add an alias (https://linuxhint.com/configure-use-aliases-zsh/)
1 |
alias DeleteDerivedData='rm -rf ~/Library/Developer/Xcode/DerivedData' |
Now open terminal and type
1 |
source ~/.zshrc |
Now type DeleteDerivedData, and notice the derived data has been deleted!