Skip to content

Instantly share code, notes, and snippets.

@maximebories
Forked from Justintime50/reset-xcode-install.md
Created August 21, 2022 00:57
Show Gist options
  • Save maximebories/e4c016a59ace6fdd4288cac533cab313 to your computer and use it in GitHub Desktop.
Save maximebories/e4c016a59ace6fdd4288cac533cab313 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

sudo rm -rf $(xcode-select -print-path)

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