Skip to content

Instantly share code, notes, and snippets.

@gilberto9312
Forked from Justintime50/reset-xcode-install.md
Created November 27, 2022 18:40
Show Gist options
  • Save gilberto9312/6fd5a493adde6ce73e10817fc1be9f21 to your computer and use it in GitHub Desktop.
Save gilberto9312/6fd5a493adde6ce73e10817fc1be9f21 to your computer and use it in GitHub Desktop.
Reset Your Xcode Installation on macOS

Reset your Xcode Install on macOS

Having troubles with Xcode or their Command Line Tools? Follow this guide to reset your Xcode instance on macOS and resolve issues such as "No Xcode or CLT version detected!"

1) Check if Xcode is installed

xcode-select -print-path

# If the output of the above command is not similar to the following line, Xcode is not installed. Skip to Step 3.
# /Library/Developer/CommandLineTools

2) Remove Bad Xcode Installation

# Remove Developer folder
sudo rm -rf $(xcode-select -print-path)

# Remove CommandLineTools folder
sudo rm -rf /Library/Developer/CommandLineTools

3) Install Xcode

sudo xcode-select --install

Messing with Xcode's Path

If the above didn't resolve your issue, you may have a problem with the path Xcode is installed at. Use the following to help if necessary.

# Switch Xcode's path
sudo xcode-select -switch /Library/Developer/CommandLineTools

# Reset Xcode's path
sudo xcode-select --reset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment