Created
September 15, 2019 22:46
-
-
Save TylerJaacks/1ebff29e5739dfa4ea10325c737af473 to your computer and use it in GitHub Desktop.
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 | |
# Xcode Uninstaller | |
echo -e "Welcome to Xcode Uninstaller\n" | |
root_user_check() { | |
if [[ $EUID -ne 0 ]]; then | |
echo "Xcode Uninstaller must run in root." | |
exit 1 | |
fi | |
} | |
confirm_uninstall() { | |
read -p "Are you sure you want to uninstall Xcode. Press y or n." -n 1 -r | |
if [[ ! $RESPONSE =~ ^[Nn]$ ]] | |
then | |
exit 1 | |
fi | |
} | |
uninstall() { | |
echo "Removing /Applications/Xcode.app" | |
rm -rf /Applications/Xcode.app | |
echo "Removing /Library/Preferences/com.apple.dt.Xcode.plist" | |
rm -rf /Library/Preferences/com.apple.dt.Xcode.plist | |
echo "~/Library/Preferences/com.apple.dt.*.plist" | |
rm -rf ~/Library/Preferences/com.apple.dt.*.plist | |
echo "~/Library/Caches/com.apple.dt.*" | |
rm -rf ~/Library/Caches/com.apple.dt.* | |
echo "~/Library/Application Support/Xcode" | |
rm -rf ~/Library/Application Support/Xcode | |
echo "~/Library/Developer/Xcode" | |
rm -rf ~/Library/Developer/Xcode | |
echo "~/Library/Developer/CoreSimulator" | |
rm -rf ~/Library/Developer/CoreSimulator | |
echo "~/Library/Developer/Xcode" | |
rm -rf ~/Library/Developer/Xcode | |
echo "~/Library/Developer/CoreSimulator" | |
rm -rf ~/Library/Developer/CoreSimulator | |
} | |
root_user_check | |
#confirm_uninstall | |
uninstall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment