Skip to content

Instantly share code, notes, and snippets.

@matiasvillaverde
Last active July 30, 2020 19:37
Show Gist options
  • Save matiasvillaverde/b10ad7f6460732e190afea0ef410afbd to your computer and use it in GitHub Desktop.
Save matiasvillaverde/b10ad7f6460732e190afea0ef410afbd to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e -u -o pipefail
main() {
echo '🔪 Kill Xcode'
if pgrep Xcode; then killall Xcode; fi
echo '💣 Delete cache'
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
echo '🛀 Clean all targets'
xcrun -k
xcodebuild -alltargets clean
echo '🧹 Cleaning derived data'
rm -rf ~/Library/Developer/Xcode/DerivedData/*
echo '🤬 Insult Xcode for you'
echo '🚀 Open Xcode'
open /Applications/Xcode.app
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment