How to completely uninstall Xcode on a Mac
- Components first, app second. Remove platforms and simulator runtimes in Xcode › Settings › Components while Xcode is still installed, then move Xcode to the Trash.
- What it costs you: the archives of builds you shipped, if you delete
~/Library/Developerwhole. Everything else in there is rebuilt or downloaded again. Your projects aren’t in it. - What stays behind:
~/Library/Developer, which is often bigger than Xcode itself, and the separate command line tools in/Library/Developer/CommandLineTools.
Check your own Mac. SiftMac’s free scan lists what’s using space and says, for each item, whether it comes back on its own.
Download the free scanMac · macOS 13+ · nothing leaves your Mac
1. Remove Xcode in the right order
Xcode has no uninstaller. The order below matters because the tools that cleanly remove simulators are part of Xcode, so they stop working once the app is gone.
1. Remove platforms and simulator runtimes
- Choose Xcode › Settings and click Components in the sidebar. Apple says Xcode lists the installed components there, with the storage you can recover by removing each.
- Click the information button next to a platform or simulator runtime and click Delete. Repeat for each one.
2. Delete the simulators
Each simulator is a small disk of its own with test apps and data. Quit the Simulator app, then let Xcode’s own tool remove the ones whose runtimes are now gone:
xcrun simctl delete unavailable
3. Move Xcode to the Trash
- Quit Xcode.
- In Finder’s Applications folder, drag Xcode to the Trash, or select it and choose File › Move to Trash. Enter an administrator password if asked.
- Choose Finder › Empty Trash.
If you keep several versions, such as an Xcode-beta, each is its own app. Apple’s xcode-select --print-path shows which one the command line currently points at.
2. What Xcode leaves in ~/Library/Developer
The app is only part of it. Xcode’s working data lives in your home folder:
~/Library/Developer/Xcode/DerivedData
~/Library/Developer/Xcode/Archives
~/Library/Developer/Xcode/iOS DeviceSupport
~/Library/Developer/Xcode/UserData
~/Library/Developer/CoreSimulator/Devices
~/Library/Developer/CoreSimulator/Caches
~/Library/Developer/Packages
- DerivedData: indexes, logs and build products. Apple’s Xcode Help says it can be re-created at any time from your source files. See Xcode DerivedData.
- Archives: the builds you made with Product › Archive, with their debug symbols. These don’t come back. See Xcode archives.
- iOS DeviceSupport: symbols Xcode copied from devices you connected. See iOS DeviceSupport.
- CoreSimulator: the simulators and their caches. If you skipped step 2, they’re still here. See Xcode simulators.
- Packages: Apple’s documentation names
~/Library/Developer/Packages/as where Xcode stores hardware support updates it downloads.
Measure the folder before deciding. It’s common for it to outweigh the app:
du -sh ~/Library/Developer/* 2>/dev/null
du -sh ~/Library/Developer/Xcode/* 2>/dev/null | sort -h
The command line tools
Apple’s technical note on the tools says two things. Xcode includes all of the command-line tools, so removing Xcode removes that copy. And if the /Library/Developer/CommandLineTools directory exists, the tools were also installed on their own, and removing that directory uninstalls them.
To remove it, open /Library/Developer with Go › Go to Folder and drag CommandLineTools to the Trash; Finder asks for an administrator password. This folder is not part of macOS’s sealed system, and xcode-select --install puts it back.
3. What to keep
- Your projects. Source code, project files and schemes live wherever you created them, not in
~/Library/Developer. Uninstalling Xcode doesn’t touch them. - Archives of versions people still use. An archive’s debug symbols only match the build they were made with, so archiving the same code again doesn’t replace one. Copy
Archivessomewhere safe if you ship apps. - UserData. Xcode keeps data tied to you rather than to a project here. Measure it; it’s usually small. Keep it if you might come back to Xcode.
- The command line tools, usually. If you still build software from Terminal, with Homebrew or other tools that compile code, keep
/Library/Developer/CommandLineTools. It takes far less space than Xcode.
If space is the real goal and you still develop, you don’t need to uninstall at all. Clearing DerivedData, unused runtimes and old device support usually frees more than the app does: see developer files on a Mac.
4. Check that it’s gone
Ask the system where its developer tools are:
xcode-select --print-path
- A path inside
Xcode.appmeans a copy of Xcode is still installed somewhere. /Library/Developer/CommandLineToolsmeans only the standalone tools remain.- An error means neither is installed.
Then confirm the folders, without changing anything:
ls /Applications | grep -i xcode
ls ~/Library/Developer 2>/dev/null
ls /Library/Developer 2>/dev/null
On the Mac this page was written on, which has the standalone tools and no Xcode, the second command printed nothing and the third printed only CommandLineTools. Finally, check System Settings › General › Storage: the Developer line there should shrink once the Trash is emptied.
Questions
Does deleting Xcode remove the simulators?
Not reliably. Simulators and their data live in ~/Library/Developer/CoreSimulator, outside the app. Remove runtimes in Xcode › Settings › Components and run xcrun simctl delete unavailable before deleting Xcode.
Is it safe to delete ~/Library/Developer after uninstalling Xcode?
Mostly. DerivedData, device support and simulators are rebuilt or downloaded again. Archives are not: copy them first if you’ve shipped apps and still need to read their crash reports.
How do I uninstall the Xcode command line tools?
Apple says to remove the /Library/Developer/CommandLineTools directory if it exists. Drag it to the Trash in Finder with an administrator password. xcode-select --install reinstalls it.
Will uninstalling Xcode delete my projects?
No. Projects stay in the folders where you saved them. Only Xcode’s build data, archives and simulators are in ~/Library/Developer.
How SiftMac handles it. SiftMac’s Developer files category lists stale DerivedData, old device support files and unused simulators separately, each with its own verdict, most of them Rebuilds; it never lists Archives. That lets you clear Xcode’s leftovers without deleting ~/Library/Developer whole. What you pick there is deleted straight away, not kept on the Undo Shelf, and simulators go through xcrun simctl delete.
Download SiftMac · scanning is free, and so is up to 20 GB of cleaning for 7 days · See how it works