Xcode-select –install xcode-select: Error: unknown command option ‘–install’

command-line-argumentsterminalxcode

i am trying to install Command line tools on Xcode from terminal.I am using Xcode

Version 5.1.1 (5B1008).
I have installed command line tools within Xcode,enter image description here

Now if i try to install Command Line tools in terminal i get thisenter image description here

How to solve this ? xcode-select version 2311.I tried the following things

1.my path is /Applications/Xcode.app/Contents/Developer,so i switched like this

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

Nothing happened i get same error command not found.

2.I followed this link but was not useful xcrun: Error: could not stat active Xcode path '/Volumes/Xcode/Xcode45-DP1.app/Contents/Developer'. (No such file or directory)

Any thoughts are welcome

Best Answer

This same problem stumped me for over an hour when setting up a new MacBook Pro with the latest version of High Sierra.

The solution - curiously - was that:

  • copying & pasting "xcode-select --install" failed continually, but
  • typing in the same command "xcode-select --install" worked immediately.

(Someone else may understand why pasting a simple line of code did not produce the same result as entering it from the keyboard.)