awesome-ios-developer/clean-xcode.sh
2021-06-03 15:25:40 -05:00

30 lines
590 B
Bash

#!/usr/bin/env bash
# 1
echo "Removing Derived Data..."
rm -rf ~/Library/Developer/Xcode/DerivedData/
# 2
echo "Removing Device Support..."
rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport
rm -rf ~/Library/Developer/Xcode/watchOS\ DeviceSupport
rm -rf ~/Library/Developer/Xcode/tvOS\ DeviceSupport
# 3
echo "Removing old simulators..."
xcrun simctl delete unavailable
# 4
echo "Removing caches..."
rm -rf ~/Library/Caches/com.apple.dt.Xcode
rm -rf ~/Library/Caches/org.carthage.CarthageKit
# 5
if command -v pod &> /dev/null
then
# 6
pod cache clean --all
fi
echo "Done!"