Q:

How to Completely Uninstall Xcode and Clear All Settings

I have an issue that I can only assume is with Xcode, where my apps take forever to run and crash the phone/restart about 75% of the time. I tried using older versions of the code that I'd saved instead, but they had the same effect, which they didn't use to have about a month ago. 
I've looked up every single possible way to solve this issue for the past few weeks have haven't found anything, so I want to completely uninstall Xcode and clear all settings; but I can't find a way to do this. I can uninstall it, but when I reinstall it, it still has all of my old settings and lists of projects etc. How can I completely uninstall it?

A:

For complete removal old Xcode 7 you should remove

/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

A:

For a complete removal of Xcode 10 delete the following:

/Applications/Xcode.app 
~/Library/Caches/com.apple.dt.Xcode
~/Library/Developer 
~/Library/MobileDevice
~/Library/Preferences/com.apple.dt.Xcode.plist
/Library/Preferences/com.apple.dt.Xcode.plist
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.bom
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.plist
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.bom
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.plist
/private/var/db/receipts/com.apple.pkg.Xcode.bom

But instead of 11, open up /private/var/in the Finder and search for "Xcode" to see all the 'dna' left behind... and selectively clean that out too. I would post the pathnames but they will include randomized folder names which will not be the same from my Mac to yours.
but if you don't want to lose all of your customizations, consider saving these files or folders before deleting anything:

~/Library/Developer/Xcode/UserData/CodeSnippets
~/Library/Developer/Xcode/UserData/FontAndColorThemes
~/Library/Developer/Xcode/UserData/KeyBindings
~/Library/Developer/Xcode/Templates
~/Library/Preferences/com.apple.dt.Xcode.plist
~/Library/MobileDevice/Provisioning Profiles

A:

Open Storage Management 

Go to  > About This Mac > Window > Storage Management
Or, hit ⌘ + Space to open Spotlight and  search for Storage Management.

Select Applications on left pane.
Right click on Xcode on the right pane and select delete.

This will remove XCode from the installed applications list of your Mac's App Store.
Update: This worked for me on macOS Sierra 10.12.1.

