Unable to use xcodebuild on Mavericks with Command Line Tools installed

前端 未结 9 1333
后悔当初
后悔当初 2020-12-07 14:34

I have installed the Command Line Tools:

$ xcode-select --print-path
/Library/Developer/CommandLineTools

However, when anything tries to us

相关标签:
9条回答
  • 2020-12-07 15:13

    I know that this is a late answer, but in my case this command solved the issue:

    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    
    0 讨论(0)
  • 2020-12-07 15:17

    There's also a GUI to change the Command Line Tools path in Xcode > Preferences > Locations:

    I just had this issue after upgrading to Xcode 10.3 while keeping an older copy of 10.2.1 in a sub-folder in Applications. When I opened this Locations panel the selection for Command Line Tools was blank, but I was able to choose between the two versions installed:

    I tend to go with the GUI option if it's available instead of copying in sudo commands from SO.

    0 讨论(0)
  • 2020-12-07 15:18

    This issue was due to xcode-select developer directory pointing to /Library/Developer, which only contained the folder CommandLineTools. To this end, the error message is complaining about not the directory not being the same as Xcode.

    Two tested solutions:

    1. (Re) Install Xcode.

    2. Point xcode-select to the Xcode Developer Directory using the following command:

      sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
      

    References:

    How to fix error like “xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory * BROKEN LINK *

    xcode-select active developer directory error

    0 讨论(0)
提交回复
热议问题