Uninstalling Xcode on macOS is not as simple as dragging the app to the Trash. The developer tools install dozens of supporting files—command-line tools, simulators, caches, and preferences—that can take up tens of gigabytes. This guide walks you through removing Xcode and its associated components completely, freeing up disk space and leaving no broken references behind.
What You’ll Need
- An administrator account on your Mac (you’ll be prompted for your password)
- About 15–30 minutes, depending on the size of your Xcode installation
- Optional: a backup of any projects you still need (Xcode itself doesn’t delete your source code, but it’s a good safety habit)
Step-by-Step
1. Quit Xcode and related processes
Press Cmd + Q to quit Xcode if it’s running. Also check the menu bar for any background processes like Simulator or CoreSimulator. You can verify nothing is running by opening Activity Monitor (in Applications > Utilities) and searching for “Xcode� or “Simulator.� If you see any, select them and click the stop button.
2. Move Xcode to the Trash
Open Finder and go to your Applications folder. Locate Xcode.app. Drag it to the Trash. If you installed Xcode elsewhere (for example, in a custom folder), move that copy instead. If Finder says the app is in use, go back to step 1 and make sure all related processes are closed.
3. Delete the Xcode data in your home Library
These hidden folders hold caches, preferences, and saved states. Open Finder, press Cmd + Shift + G, and paste each of the following paths one at a time. Delete the Xcode or com.apple.dt.Xcode items inside each folder:
~/Library/Caches/com.apple.dt.Xcode~/Library/Preferences/com.apple.dt.Xcode.plist~/Library/Application Support/Xcode~/Library/Developer(this contains CoreSimulator devices and derived data—deleting it removes simulator runtimes and cached builds)~/Library/Logs/Xcode~/Library/Developer/Xcode(if it exists separately)
If any of these folders don’t exist, that’s fine—skip them.
4. Remove the shared developer directory
Xcode also installs files system-wide at /Library/Developer. Open Finder, press Cmd + Shift + G, and go to /Library/Developer. Delete the entire Developer folder. You may need to enter your admin password. This removes the shared toolchains, SDKs, and platform support files.
5. Uninstall the command-line tools (optional but recommended)
If you want a completely clean removal, the command-line tools (like clang and git) that Xcode installed should also go. Open Terminal (in Applications > Utilities) and run:
sudo rm -rf /Library/Developer/CommandLineTools
This requires your password. If you plan to reinstall Xcode later, you can skip this step—the tools will be overwritten anyway. If you only use the command-line tools and not the full Xcode app, consider keeping this folder and just removing the app.
6. Clear the system caches and logs
Open Terminal and run these commands to remove any remaining system-level caches:
sudo rm -rf /Library/Caches/com.apple.dt.Xcode
sudo rm -rf /Library/Logs/DiagnosticReports
The second command clears all diagnostic reports, not just Xcode’s—if you want to keep other reports, skip it.
7. Empty the Trash
Right-click the Trash icon in the Dock and select Empty Trash. This permanently deletes Xcode and all the files you moved. If you want to be extra thorough, restart your Mac afterward to flush any lingering file handles.
Common Mistakes
- Only dragging Xcode.app to the Trash. This leaves gigabytes of SDKs, simulators, and caches behind. The app is the smallest part of the installation.
- Deleting the wrong Library folder. Your user Library (
~/Library) is different from the system Library (/Library). Deleting the system Library’s Developer folder is fine, but don’t delete the whole/Libraryfolder. - Skipping the command-line tools removal. If you want a true clean slate, those tools take up about 10 GB. Many users forget them.
- Not quitting Simulator first. The Simulator app can hold locks on CoreSimulator files, causing the deletion to fail with “file in use.�
- Using third-party “uninstaller� apps without checking what they remove. These can delete unrelated developer files. Manual removal is safer.
Tips
- Before starting, check your disk usage with About This Mac > Storage to see how much space Xcode was using. After removal, compare to confirm the cleanup worked.
- If you plan to reinstall Xcode later, write down your Apple ID—you’ll need it to download from the App Store.
- Your Xcode projects (source code) live in your own folders, not inside Xcode. They will not be deleted by this process.
- If you use Homebrew, some packages may depend on the command-line tools. After removal, you may need to reinstall them with
brew reinstallif you later reinstall Xcode. - Consider using
sudo du -sh /Library/Developerbefore deleting to see exactly how much space that folder uses—it’s often a surprise.
Troubleshooting
“The operation can’t be completed because the item is in use.�
This means a process still has a file open. Go to Activity Monitor, search for “Xcode,� “Simulator,� “CoreSimulator,� or “launchd_sim.� Force quit them. If that fails, restart your Mac and try again immediately after login.
Finder won’t let me delete files in ~/Library/Developer.
Some subfolders are read-only by default. Use Terminal instead: rm -rf ~/Library/Developer. You may need to prefix with sudo if you get permission errors, though your own Library shouldn’t require it.
After deleting, Terminal still shows clang or git.
That’s because the command-line tools are still installed. Run the sudo rm -rf /Library/Developer/CommandLineTools command from step 5. If they still appear, they might be installed via Homebrew—check with brew list and remove them with brew uninstall if needed.
Xcode won’t drag to Trash because it’s “damaged.�
This can happen if the app bundle is corrupted. Open Terminal and run sudo rm -rf /Applications/Xcode.app to force-remove it.
Disk space didn’t free up as much as expected.
Check ~/Library/Developer/Xcode/DerivedData—it can hold many gigabytes of build caches. Also check ~/Library/Developer/CoreSimulator for old simulator runtimes. Delete those folders manually if they remain.
Frequently Asked Questions
Will uninstalling Xcode delete my app projects?
No. Your source code and Xcode projects are stored wherever you saved them (usually in your Documents or a projects folder). Xcode itself doesn’t contain your work. The only thing you lose is the app and its developer tools.
Do I need to uninstall the command-line tools separately?
Yes, if you want a complete removal. The command-line tools are a separate package installed at /Library/Developer/CommandLineTools. Removing Xcode.app alone doesn’t touch them.
Can I reinstall Xcode from the App Store after this?
Absolutely. Just open the App Store, search for Xcode, and download it again. You’ll need your Apple ID and enough free disk space (the download is several gigabytes).
Is there a way to uninstall Xcode without using Terminal?
Yes, you can do all the file deletions in Finder using Cmd + Shift + G to navigate to the hidden paths. The only step that really requires Terminal is removing the command-line tools, since they’re in a system folder that Finder may not let you delete directly.
What if I only want to free up space but keep Xcode for later?
You can delete the DerivedData folder (~/Library/Developer/Xcode/DerivedData) and old simulator runtimes (~/Library/Developer/CoreSimulator) without uninstalling the app. This often frees up 10–20 GB.
Does uninstalling Xcode affect other Apple development tools like Swift Playgrounds?
Swift Playgrounds is a separate app and won’t be removed. However, it may rely on some of the same SDKs. If you delete /Library/Developer, Swift Playgrounds might not run projects that need those system frameworks. You can reinstall Xcode or the command-line tools to restore them.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Google Desktop Search Widget on Windows 11
- How to Build a Computer Stand (Saturday Workshop)
- Customize Touch Keyboard Themes in Windows 11
- Excel Pivot Table: Change Multiple Field Settings
- WhatsApp: How to Block Unknown Numbers
- How to Exit Vi in Linux: A Simple Guide