How to completely uninstall Xcode on Mac
Dragging Xcode to the Trash removes the app itself, but its support files, caches and settings stay on your Mac. Here is where they are and how to remove all of them.
The app itself is large, but most of Xcode's space is outside it: DerivedData, simulator runtimes and devices, device support files and archives under ~/Library/Developer. Dragging Xcode to the Trash leaves all of that behind.
Keep any Archives you may need to resubmit or symbolicate, and copy out anything you want from ~/Library/Developer/Xcode/UserData (snippets, key bindings, themes). The Command Line Tools in /Library/Developer/CommandLineTools are a separate install that Homebrew and other tools may rely on.
com.apple.dt.XcodeRemove Xcode by hand
- Quit Xcode. If it has a menu bar icon or runs in the background, quit that too.
- Open the Applications folder and drag Xcode to the Trash.
- In Finder, choose Go > Go to Folder (Shift-Command-G), paste each location below, and move what you find to the Trash. Not every location exists for every version.
- Empty the Trash, then restart your Mac so nothing from Xcode is left running.
Where Xcode keeps its files
/Applications/Xcode.app~/Library/Application Support/Xcode~/Library/Application Support/com.apple.dt.Xcode~/Library/Caches/com.apple.dt.Xcode~/Library/Preferences/com.apple.dt.Xcode.plist~/Library/Saved Application State/com.apple.dt.Xcode.savedState~/Library/Containers/com.apple.dt.Xcode~/Library/HTTPStorages/com.apple.dt.Xcode~/Library/WebKit/com.apple.dt.Xcode~/Library/Logs/Xcode~/Library/Logs/com.apple.dt.Xcode
Other places Xcode uses
~/Library/Developer/XcodeData~/Library/Developer/CoreSimulatorData~/Library/Developer/DVTDownloadsData~/Library/Developer/CoreDeviceData/Library/Developer/CoreSimulatorData
Items under /Library need your administrator password to remove.
The quick way
Diskzy finds Xcode and the files listed here, shows the size of each one, and moves them to the Trash together. Files that another app also uses are left alone.
More uninstall guides
See where your Mac's space went
Diskzy maps your disk, explains System Data and clears what's safe. Free for 72 hours, then $9 once for 2 Macs.
Try Diskzy for free