Skip to content

Instantly share code, notes, and snippets.

@beefon
Last active March 2, 2020 12:53
Show Gist options
  • Save beefon/c0d64e6ecc40432899e2654b334a7947 to your computer and use it in GitHub Desktop.
Save beefon/c0d64e6ecc40432899e2654b334a7947 to your computer and use it in GitHub Desktop.
removeDerivedData PROJECT_NAME
setopt extended_glob
removeDerivedData() {
local project_name=$1
if [[ -z "$project_name" ]]
then
rm -rf ~/Library/Developer/Xcode/DerivedData/*/^Index
else
rm -rf ~/Library/Developer/Xcode/DerivedData/"$project_name"*/^Index
fi
}

Allows to clean up DerivedData for specific project name but leave Index folder untouched. This keeps Xcode indexes alive allows to just rebuild sources without re-indexing your project.

Usage:

  • $ removeDerivedData - nuke DD for all projects
  • $ removeDerivedData MyApp - nuke DD for MyApp project only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment