Before you start
- Do you only need space? Clearing DerivedData and simulators often frees more than uninstalling.
- Keep the Command Line Tools if you use
git, Homebrew or compilers. They're separate from Xcode. - Export any archives whose dSYMs you need to symbolicate crash reports.
Remove simulator runtimes first
Runtimes live in a system location that Xcode manages; deleting them with simctl while Xcode is still installed is the clean way.
xcrun simctl runtime listxcrun simctl runtime delete allDelete Xcode and its folders
Quit Xcode, then remove its data from your Library. After that, drag /Applications/Xcode.app to the Trash and empty it.
rm -rf ~/Library/Developer/Xcode ~/Library/Developer/CoreSimulator ~/Library/Caches/com.apple.dt.Xcoderm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist ~/Library/Developer/XCPGDevicesrm -rf is permanent: nothing goes to the Trash. Double-check each path before pressing Return.
Optionally: Command Line Tools
Only if you don't use developer tools at all. Run xcode-select --install to get them back.
sudo rm -rf /Library/Developer/CommandLineToolsWith Broom
Broom's Applications screen shows Xcode's full footprint, app plus Library data, and uninstalls it with its leftovers. Cleanup lists DerivedData, archives, device support and simulators separately if you'd rather keep Xcode. Either way everything goes to the Trash, so nothing is permanent until you empty it.
Questions
How much space does Xcode really use?
The app is about 10 GB. With DerivedData, simulators and device support, 40–100 GB is common on an active developer Mac.
Does uninstalling Xcode remove git?
No. git comes from the Command Line Tools, a separate install, unless you remove /Library/Developer/CommandLineTools.
Can I just delete ~/Library/Developer?
Yes, if you're removing Xcode. It holds DerivedData, archives, device support and simulators, all of which are Xcode data.