How to check if command line tools is installed

后端 未结 10 2112
执念已碎
执念已碎 2020-11-30 18:02

I have a macbook pro with OS X 10.8.2. XCode is installed. I know this as it appears in the Applications directory. There are also the xcodebuild and xcode-select files in /

相关标签:
10条回答
  • 2020-11-30 18:50

    Open your terminal and check to see if you have Xcode installed already with this:

    xcode-select -p
    

    in return, if you get this:

    /Library/Developer/CommandLineTools
    

    That means you have that Xcode is installed.

    Another way you can check would you if you have "HomeBrew" installed you can use the following command to see if you have Xcode and the version:

    brew config
    

    And finally, if you don't have the Xcode follow this link to download the Xcode from the Appstore. Xcode from the App Store.

    Good Luck.

    0 讨论(0)
  • 2020-11-30 18:51

    Go to Applications > Xcode > preferences > downloads

    You should see the command line tools there for you to install.

    0 讨论(0)
  • 2020-11-30 18:52

    To check if command line tools are installed run:

    xcode-select --version
    
    // if installed you will see the below with the version found in your system
    // xcode-select version 1234.
    

    If command line tools are not installed run:

    xcode-select --install
    
    0 讨论(0)
  • 2020-11-30 18:53

    From a programmatic perspective the Homebrew folks have a check for the existence of various files to determine if the command line tools are installed. Currently it always checks for /Library/Developer/CommandLineTools/usr/bin/git and will also check for /usr/include/iconv.h if the OS version is 10.13 or below.

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