How to clean uninstall Xcode on Mac

Many times it happens that you update your MacOS and then some new update comes up for the Xcode version and there is a backwards compatibility issue. Then you go to the App Store on your Mac to update the Xcode and Bam! You end up wasting hours because the installation gets stuck. It keeps showing installing for hours. If you force shutdown your MacOS and restart, then again the same story.

This time it happened with me again after I updated MacOS Catalina and installation of Xcode 11.3 just doesn’t end. Stopping in App Store doesn’t work.

Another way is, going to the Launchpad and holding down the alt/option key till all the icons start to jiggle. Then click on the x icon and you’ll be prompted to confirm to delete the Xcode App. Well, this also didn’t work for me. Then restart your Mac to move to the next steps.

Go to the Applications folder and find the Xcode App, right-click on it and move it to Trash/Bin. Empty the Trash/Bin.

For newer versions of Xcode, this step should be sufficient. You can go ahead and re-install Xcode from the App Store.

Removing from the Terminal

You need to run the following command in order to completely remove Xcode:

sudo /Developer/Library/uninstall-devtools --mode=all

The above command requires the admin password for sudo. If you get the error that the above command not found, then it probably doesn’t work for the newer versions of Xcode.

The following folders are cleared with complete uninstallation of Xcode. You might need to consider backing up the data in case you have Projects in the Developer folder and certain preferences to preserve in case you’re reinstalling.

  • /Applications/Xcode.app
  • /Library/Preferences/com.apple.dt.Xcode.plist
  • ~/Library/Preferences/com.apple.dt.Xcode.plist
  • ~/Library/Caches/com.apple.dt.Xcode
  • ~/Library/Application Support/Xcode
  • ~/Library/Developer/Xcode
  • ~/Library/Developer/CoreSimulator

Remove the files at ~/Library/Caches/com.apple.dt.Xcode is basically clearing the cache.

Share your experience on what worked for you to make this post better.

2 thoughts on “How to clean uninstall Xcode on Mac

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.