Skip to content

Instantly share code, notes, and snippets.

@TylerJaacks
Created September 15, 2019 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TylerJaacks/1ebff29e5739dfa4ea10325c737af473 to your computer and use it in GitHub Desktop.
Save TylerJaacks/1ebff29e5739dfa4ea10325c737af473 to your computer and use it in GitHub Desktop.
#! /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