Xcode
Uninstall
MacOS
Developer Tools
Settings Reset

How to Completely Uninstall Xcode and Clear All Settings

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

Completely uninstalling Xcode means removing more than the application bundle in /Applications. Xcode also leaves behind derived data, simulator content, archives, user preferences, and sometimes standalone command line tools, so a real reset requires clearing those locations deliberately.

Remove the Xcode Application Bundle

If Xcode was installed in the normal location, start by deleting the main app bundle.

bash
sudo rm -rf /Applications/Xcode.app

That frees the largest single chunk of disk space, but it does not remove your build caches, simulator data, or settings. If you skip the remaining cleanup, a new installation may still inherit old state.

Remove Developer Caches and Build Data

Xcode stores a large amount of per-user data under your home directory. The most common reset targets are DerivedData, Archives, and device support files.

bash
1rm -rf ~/Library/Developer/Xcode/DerivedData
2rm -rf ~/Library/Developer/Xcode/Archives
3rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport
4rm -rf ~/Library/Caches/com.apple.dt.Xcode

These directories often consume many gigabytes. Removing them is also useful when the goal is not just uninstalling Xcode, but fixing corrupted indexing, stale builds, or odd debugger behavior.

If you want a truly clean slate, also remove simulators and related developer content:

bash
rm -rf ~/Library/Developer/CoreSimulator

Be aware that this deletes installed simulators and their app data.

Clear Preferences and User-Specific Settings

Xcode writes preference files and state under the Library directory in your home folder. To clear editor settings, window layouts, and saved state, remove the relevant preference files.

bash
1rm -f ~/Library/Preferences/com.apple.dt.Xcode.plist
2rm -rf ~/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState
3rm -rf ~/Library/Application\ Support/Xcode
4rm -rf ~/Library/Logs/DiagnosticReports/Xcode*

This is the part that resets Xcode's local behavior, not just its binaries. If the issue is a broken preference, deleting only the app bundle will not help.

Reset Command Line Tools if Needed

Some systems also have separate command line developer tools installed outside the Xcode app bundle. If you want to remove those too, inspect the active developer directory first:

bash
xcode-select -p

If it points into Xcode, deleting the app bundle may leave xcode-select pointing at a path that no longer exists. Reset it or switch it.

bash
sudo xcode-select --reset

If standalone command line tools were installed, they are often located under /Library/Developer/CommandLineTools. Removing them looks like this:

bash
sudo rm -rf /Library/Developer/CommandLineTools

That step is optional if your goal is only to reinstall the Xcode app, but it matters if you want a full developer-tool reset.

Verify the Machine Is Clean

After removal, check the obvious locations.

bash
ls /Applications | grep Xcode
ls ~/Library/Developer
xcode-select -p

You should no longer see Xcode.app, and xcode-select should either be reset or point somewhere intentional. If you plan to reinstall, a clean verification step saves time because it separates a bad reinstall from leftover state you forgot to remove.

Reinstall With Intention

If the goal is a fresh working setup, reinstall Xcode from the App Store or another approved distribution method and then launch it once to let it install required components. After that, re-add only the simulators and settings you actually need rather than copying old state back into place.

A clean reinstall is especially useful when troubleshooting:

  • corrupted DerivedData
  • broken simulator runtimes
  • invalid command line tool paths
  • stale signing or indexing state

The less old state you carry over, the easier it is to tell whether the problem is actually fixed.

Common Pitfalls

  • Deleting only /Applications/Xcode.app does not remove caches, preferences, or simulator data, so the system is not truly reset.
  • Removing ~/Library/Developer/CoreSimulator without realizing it deletes simulator devices and app data can wipe useful test state unexpectedly.
  • Forgetting to run xcode-select --reset may leave developer tools pointing at a deleted Xcode path.
  • Using broad rm -rf commands without checking the exact path is dangerous. Verify each location before running it with sudo.
  • Assuming a reinstall will fix preference corruption while leaving old plist files and caches in place often leads to the same broken behavior returning immediately.

Summary

  • A complete Xcode uninstall includes the app bundle, caches, DerivedData, archives, simulator state, and preferences.
  • Remove /Applications/Xcode.app first, then clear user-level developer directories.
  • Reset or remove command line tools if you want a full development-tool cleanup.
  • Verify the active developer path after uninstalling so xcode-select is not left broken.
  • Reinstall from a clean state to avoid carrying corrupted configuration back into the new setup.

Course illustration
Course illustration

All Rights Reserved.