Created
January 3, 2022 18:44
-
-
Save astrokin/b1f56ba9316def585372465084af3211 to your computer and use it in GitHub Desktop.
iOS developer clear disk usage cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
killall Xcode | |
echo 'Xcode process killed' | |
xcrun -k | |
echo 'Remove the cache. Causes all values to be re-cached' | |
xcodebuild -alltargets clean | |
echo 'clean all targets' | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
echo 'ModuleCache removed' | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
echo 'User ModuleCache removed' | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
echo 'DerrivedData removed' | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
echo 'Xcode Caches removed' | |
defaults delete com.apple.dt.Xcode | |
echo 'Defaults removed' | |
for file in `ls ~/Library/Preferences/ | grep Xcode`; do rm "/Users/$(whoami)/Library/Preferences/${file}"; done | |
echo 'Preferences removed' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment