-
Notifications
You must be signed in to change notification settings - Fork 0
/
RemoveXcodeCache.sh
executable file
·38 lines (31 loc) · 1.11 KB
/
RemoveXcodeCache.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/bash
read -p "Continue to remove Xcode's cache? 'y' or 'n': " flag
if [[ $flag == "Y" || $flag == "y" ]]; then
if [ -e ~/Library/Developer/CoreSimulator/Devices ]; then
cd ~/Library/Developer/CoreSimulator/Devices
rm -r *
echo "removed successfully: ~/Library/Developer/CoreSimulator/Devices"
fi
if [ -e ~/Library/Developer/CoreSimulator/Caches/dyld ]; then
cd ~/Library/Developer/CoreSimulator/Caches/dyld
rm -r *
echo "removed successfully: ~/Library/Developer/CoreSimulator/Caches/dyld"
fi
if [ -e ~/Library/Developer/Xcode/DerivedData ]; then
cd ~/Library/Developer/Xcode/DerivedData
rm -r *
echo "removed successfully: ~/Library/Developer/Xcode/DerivedData"
fi
if [ -e ~/Library/Developer/Xcode/Archives ]; then
cd ~/Library/Developer/Xcode/Archives
rm -r *
echo "removed successfully: ~/Library/Developer/Xcode/Archives"
fi
if [ -e ~/Library/Developer/Xcode/iOS\ Device\ Logs ]; then
cd ~/Library/Developer/Xcode/iOS\ Device\ Logs
rm -r *
echo "removed successfully: ~/Library/Developer/Xcode/iOS Device Logs"
fi
else
echo "fail"
fi