Skip to content

Instantly share code, notes, and snippets.

@valtoni
Last active November 3, 2020 23:10
Show Gist options
  • Save valtoni/3937e05d548f2f68e4f9b5f0a572fab6 to your computer and use it in GitHub Desktop.
Save valtoni/3937e05d548f2f68e4f9b5f0a572fab6 to your computer and use it in GitHub Desktop.
Remove Xcode
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
dirs = ("$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
"$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
/Applications/Xcode.app
~/Library/Caches/com.apple.dt.Xcode
~/Library/Developer
~/Library/MobileDevice
~/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/Preferences/com.apple.dt.xcodebuild.plist
/Library/Preferences/com.apple.dt.Xcode.plist
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.bom
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.plist
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.bom
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.plist
/private/var/db/receipts/com.apple.pkg.Xcode.bom)
for dir in ${dirs[@]}; do
sudo rm -Rf "$dir"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment