Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode-select active developer directory error

Saw the following error when running an npm install which required node-gyp... but could be triggered by anything which requires xcode-select.

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

What is the problem?

like image 595
tjmehta Avatar asked Jul 31 '13 20:07

tjmehta


People also ask

Does Xcodebuild require Xcode?

No it does not. When Xcode is installed, setting the xcode-select path to Xcode app gives you more features: in particular xcodebuild which is required for making Xcode projects from cmake etc. depending on which is selected using xcode-select. The command line tools will search the SDK for system headers by default.

What is Xcode-select on Mac?

Note: macOS comes bundled with xcode-select , a command-line tool that is installed in /usr/bin . It allows you to manage the active developer directory for Xcode and other BSD development tools.

How do I find Xcode path on Mac?

Check whether the Xcode command line tools are installed on your Mac: Start Xcode on the Mac. Choose Preferences from the Xcode menu. In the General window, click the Locations tab.


1 Answers

This problem happens when xcode-select developer directory was pointing to /Library/Developer/CommandLineTools when a full regular Xcode was required (happens when CommandLineTools are installed after Xcode)

Solution:

  1. Install Xcode (get it from https://appstore.com/mac/apple/xcode) if you don't have it yet.
  2. Accept the Terms and Conditions.
  3. Ensure Xcode app is in the /Applications directory (NOT /Users/{user}/Applications).
  4. Point xcode-select to the Xcode app Developer directory using the following command:
    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Note: Make sure your Xcode app path is correct.

  • Xcode: /Applications/Xcode.app/Contents/Developer
  • Xcode-beta: /Applications/Xcode-beta.app/Contents/Developer
like image 191
tjmehta Avatar answered Sep 22 '22 00:09

tjmehta