title: Installing Xcode command line tools
body: <p>I performed a fresh install of macOS Mojave 10.14. Immediately after that I installed Xcode Version 10.0 (10A255) from the Mac App Store.</p>
  
  <p>Now, I wish to install Homebrew which requires Xcode command line tools to be installed. My understanding is that installing Xcode also installs the command line tools. Or not?</p>
  
  <p>As per <a href="https://stackoverflow.com/a/15371967/6995250">this answer</a>, I checked if the command line tools are installed by running:</p>
  
  <p><code>xcode-select -p</code></p>
  
  <p>which printed the path for the Developer directory as follows:</p>
  
  <pre><code>/Applications/Xcode.app/Contents/Developer
  </code></pre>
  
  <p>As suggested in the answer, I also verified the return value by running:</p>
  
  <p><code>echo $?</code></p>
  
  <p>which retuned <code>0</code>.</p>
  
  <p>I also ran, <code>gcc</code> and <code>make</code> and bash was able to locate and execute them.</p>
  
  <p>Thus far I am convinced that the Xcode command line tools are installed. Now when I execute:</p>
  
  <p><code>xcode-select --install</code></p>
  
  <p>I get this alert:</p>
  
  <p><a href="https://i.stack.imgur.com/nakcs.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nakcs.png" alt="enter image description here"></a></p>
  
  <p>What's the probable reason for this disparity? Will this install Xcode command line tools twice? Or overwrite the existing installation?</p>
  
  <p>As I understand, Xcode command line tools can be installed <strong>without</strong> installing Xcode. Also, from my previous experience, if the command line tools aren't installed separately from Xcode (by running <code>xcode-select --install</code>), they are not detected by Homebrew, i.e. when running <code>brew config</code>, the value for <code>CLT:</code> is shown as <code>N/A</code>.</p>
  
  <p>Here's the complete picture (pardon the pun):</p>
  
  <p><a href="https://i.stack.imgur.com/5jUmr.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5jUmr.png" alt="enter image description here"></a></p>
  
  <p>Although I am talking in context of macOS Mojave, the question remains the same with regard to previous versions of macOS.</p>
  
  <p>What is the advisable approach to take here?</p>
  
  <p><strong>Note</strong>: After installing Xcode, I launched it, accepted license agreement and let it finish its run of installing additional tools (which is a one time activity).</p>