Last active
June 10, 2022 10:15
-
-
Save earendildev/c77791827ab6a3a87bfa3b8d8bb786e2 to your computer and use it in GitHub Desktop.
This will delete and purge Xcode from the system and then proceed to reinstall it back (MacOS)
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 | |
######################################################### | |
# To Download and Install/Run | |
# $ sudo -H su -c "$(curl -fsSL https://gist.githubusercontent.com/earendildev/c77791827ab6a3a87bfa3b8d8bb786e2/raw --output $HOME/reinstall-xcode.sh)" | |
# Created by [email protected] | |
######################################################### | |
# Kill XCode Process | |
killall Xcode | |
# Clean Project Folders | |
xcrun -k | |
xcodebuild -alltargets clean | |
# Removing XCode Cache | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
# Purging XCode from System | |
rm -rf /Applications/Xcode.app | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode | |
rm -rf ~/Library/Developer | |
rm -rf ~/Library/MobileDevice | |
rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist | |
rm -rf ~/Library/Preferences/com.apple.dt.xcodebuild.plist | |
sudo rm -rf /Library/Developer/CommandLineTools | |
sudo rm -rf /Library/Preferences/com.apple.dt.Xcode.plist | |
sudo rm -rf /System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.bom | |
sudo rm -rf /System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.plist | |
sudo rm -rf /System/Library/Receipts/com.apple.pkg.XcodeSystemResources.bom | |
sudo rm -rf /System/Library/Receipts/com.apple.pkg.XcodeSystemResources.plist | |
sudo rm -rf /private/var/db/receipts/com.apple.pkg.Xcode.bom | |
# Installing XCode | |
printf "Lets Install XCode" | |
sudo xcode-select --install | |
sudo xcode-select --reset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment