Created
May 6, 2024 16:50
-
-
Save wheresjames/313b1bc4997a7b832a29727593c90dfe to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
echo "Cleaning Xcode..." | |
# Clear Xcode Caches | |
CLEANDIRS=("~/Library/Developer/Xcode/DerivedData" \ | |
"~/Library/Caches/org.swift.swiftpm" \ | |
"~/Library/Caches/org.swift.swiftpm.$USER" \ | |
"$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" \ | |
"$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$USER/ModuleCache" \ | |
"~/Library/Developer/Xcode/iOS DeviceSupport" \ | |
"~/Library/Developer/Xcode/iOS DeviceSupport Logs" \ | |
"~/Library/Developer/Xcode/macOS DeviceSupport" \ | |
"~/Library/Developer/CoreSimulator/Devices/" \ | |
"~/Library/Developer/CoreSimulator/Caches" \ | |
"~/Library/Caches/com.apple.dt.Instruments" \ | |
"~/Library/Caches/com.apple.dt.Xcode" \ | |
"~/Library/Caches/com.apple.dt.Xcode.sourcecontrol.Git") | |
for dir in "${CLEANDIRS[@]}"; do | |
full=$(eval echo $dir) | |
if [ -d "$full" ]; then | |
echo "[x] $full..." | |
rm -rf $full | |
else | |
echo "[ ] $full" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment