How to install Xcode Command Line Tools - xcode

How do I get the command-line build tools installed with the current Xcode/Mac OS X v10.8 (Mountain Lion) or later?
Unlike Xcode there is no installer, it's just a bundle.
It looks like all the command line tools are in the bundle, under Contents/Developer, but none of the appropriate environment variables are set to use them.
Is there a script I can run that will set-up my environment to support building from the command line?

Xcode 5.1 and OSX 10.9. (also works with Xcode 5.1.1 + OSX 10.10)
xcode-select --install worked with version 2333, failed with version 2003. So, try xcode-select --install and if that does not work download as described below.
In early February 2014 xcode-select --install has been reporting that "Can't install the software because it is not currently available from the Software Update server". In late February 2014 the command started only displaying help. The solution is to download directly, see "Separate Download" below.
Xcode 5.0.1 and OSX 10.9
With Xcode 5.0.1 and Mavericks 10.9 the command line tool is no longer available through Xcode. Instead they must be downloaded from the Apple Developer Tools site: https://developer.apple.com/downloads/index.action. This requires signing in with a developer account.
Or via terminal (from the release docs): The Command Line Developer Tools package can be installed on demand using "xcode-select --install” and the installed tools will be automatically updated using Software Update. OS X 10.9 is required for this feature. For earlier versions, continue to use the in-app download in Xcode.
Running the command in terminal produces the following GUI:
Inside Xcode (5.0)
Xcode includes a new "Downloads" preference pane to install optional components such as command line tools, and previous iOS Simulators. To open this pane click the "Xcode" button in the top left of the screen near the Apple logo, then click "Preferences", then click "Downloads".
Xcode 5.0 screenshot:
Xcode 4.x screenshot:
Separate Download
If you do not have Xcode, they are available as a separate download from Apple:
Go to developer.apple.com/downloads/index.action, and sign in with your Apple ID (the download's free). In the pane on the left, search for "command line tools" and choose the package appropriate to your version of OS X. Requires Mac OS X 10.7.3 or later.

If you take a look into "Console" while trying to pull the Command Line Tools, you will find out that there is actually an "unofficial" link to the Mountain Lion Command Line Tools!
So just try:
http://adcdownload.apple.com/ios/ios_simulator__resigned/cltools_mountainliondp2_march12.dmg
Here is my Console log:
01/04/2012 15:41:54.258 Xcode: [MT] DVTDownloadable: Download failed. Downloadable: {
dependencies = (
);
fileSize = 141452226;
identifier = "Xcode.CLTools.10.8";
name = "Command Line Tools";
source = "http://adcdownload.apple.com/ios/ios_simulator__resigned/cltools_mountainliondp2_march12.dmg";
userInfo = {
ActivationPredicate = "$MAC_OS_X_VERSION >= '10.8.0' && $MAC_OS_X_VERSION < '10.9.0'";
InstallPrefix = "/";
InstalledIfAllSHA1SumsMatch = {
"/usr/bin/clang" = 600c35175775a6002452a88f17e00c570cd2e2d0;
};
Summary = "Before installing, note that from within Terminal you can use the XCRUN tool to launch compilers and other tools embedded within the Xcode application. Use the XCODE-SELECT tool to define which version of Xcode is active. Type \"man xcrun\" from within Terminal to find out more.\n\nDownloading this package will install copies of the core command line tools and system headers into system folders, including the LLVM compiler, linker, and build tools.";
"Xcode.SDKs" = (
);
};
version = "1.1.1";
}. Error: Error Domain=NSCocoaErrorDomain Code=3840 "The data couldn’t be read because it has been corrupted." (Encountered unknown ampersand-escape sequence at line 18) UserInfo=0x401bc8e60 {NSDebugDescription=Encountered unknown ampersand-escape sequence at line 18, kCFPropertyListOldStyleParsingError=The data couldn’t be read because it has been corrupted.}

Here are links for Command Line Tools, located at Apple Developer Server. You may need an apple developer (Paid/Premium) account to access them. You can download current (stable and beta) Xcode Tools. (It does not need device verification. Just ensure your macOS and XCode Tool/SDK version while choosing your command line tool)
Xcode 13 RC
Xcode 13 RC
- (Command Line Tool (Xcode 13 RC) - for macOS BigSur +)
Once you've latest command line tool installed in your system, set it from Xcode Menu.
(Xcode Menu Items) Xcode ▶ Preferences ▶ Location ▶ Command Line Tool ▶ Select appropriate command line tool

As of big sur..
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Thanks homebrew maintainers for putting this helpful messaging in brew doctor

The "unofficial" links are also available at
http://developer.apple.com/downloads/
and 403: Forbidden unless logged in with a qualifying developer account. Free accounts have access to everything except prerelease software and full OS installs. In particular, the command-line tools packages that coincide with the release of Xcode 4.4 (the "July 2012" packages) were posted on July 27, for both Lion and Mountain Lion.
Unlike log files, deep-linking Web pages, and the Xcode Preferences window, this page also links to lots of other useful downloads for free and paid developers alike, including everything else that has been unbundled from Xcode (audio tools, accessibility tools, etc.), OS X kernel debug builds, and release versions of Xcode back to 1.0.

Instead of installing the "official" build of the command line tools from Apple, you can also install Kenneth's build from here:
https://github.com/kennethreitz/osx-gcc-installer
It doesn't even require XCode if all you are after is the command line tools.

I recently had to install Xcode command line tools on Mountain Lion over SSH.
Notice: I imagine this process would work identically for any version of Xcode or OSX. Just make sure you get your paths correct.
Here's how I did it...
If you don't have a free Apple developer account, register for one
Login to https://developer.apple.com/downloads
Download the "Command Line Tools for Xcode" appropriate for your version of OSX
For me, that was "Command Line Tools (OS X Mountain Lion) for Xcode - April 2014"
Copy the dmg file to your remote
In the following command, I'm using scp to securely copy the file from my local computer to the remote named remote
$ scp ~/Downloads/command_line_tools_for_osx_mountain_lion_april_2014.dmg remote:Downloads/
ssh to your remote
$ ssh remote
mount the dmg file on the remote
Here, I'm using hdiutil to mount the image
$ hdiutil attach ~/Downloads/command_line_tools_for_osx_mountain_lion_april_2014.dmg
install the package contained in the dmg
Here, installer must be run with sudo because this package needs to be installed on the root file system
$ cd /Volumes/Command\ Line\ Tools\ \(Mountain\ Lion\)
$ sudo installer -pkg Command\ Line\ Tools\ \(Mountain\ Lion\).mpkg -target /
unmount the dmg file
$ hdiutil detach /Volumes/Command\ Line\ Tools\ \(Mountain\ Lion\)
delete the dmg file from the remote; optional
I see no purpose keeping it around, but you can if you want.
$ rm ~/Downloads/command_line_tools_for_osx_mountain_lion_april_2014.dmg

You can automate the installation of Command-Line Tools in bash. I needed to do this when I was automating the developer onboarding setup process.
xcode-select --install && sleep 1
osascript -e 'tell application "System Events"' -e 'tell process "Install Command Line Developer Tools"' -e 'keystroke return' -e 'click button "Agree" of window "License Agreement"' -e 'end tell' -e 'end tell'

Go to developer.apple.com/download/all/ (log in if you're not logged in)
Expand the "View Details" tool tip for "Command Line Tools" of the version you need
Download the .dmg file of those Command Line Tools
Once the .dmg file is downloaded, double click it and install it

If you want to use the version of tools provided in XCode itself you can use xcrun (e.g. xcrun git). From the help at the bottom of the download preference pane:
note that from within Terminal you can use the XCRUN tool to launch
compilers and other tools embedded within the Xcode application. Use
the XCODE-SELECT tool to define which version of Xcode is active.
Type "man xcrun" from within Terminal to find out more.

UPDATED: On Lion 10.7.4 the Command Line Tools are already available from withing XCode. You can get it freely from App Store.
The GCC for OSX won't compile some packages obtained from macports.
https://github.com/kennethreitz/osx-gcc-installer/downloads

By updating my Mac to the latest Mac OS (ie Big Sur), everything broke down to repetition request of installing Xcode-select.
It might seem weird, but I solved the problem by reinstalling & updating to the latest Xcode.
This is just my experience to solve the problem.

try going into Xcode > Preferences... > Downloads and clicking the button with a downward arrow in a circle next to command line tools.

xcode command line tools can be downloaded from here: https://developer.apple.com/downloads/index.action#
April 2014 version direct download link (for developers who just want to get started right away)
https://developer.apple.com/downloads/download.action?path=Developer_Tools/command_line_tools_os_x_mavericks_for_xcode__april_2014/command_line_tools_for_osx_mavericks_april_2014.dmg

How do I get the command line builds tools installed with Xcode 4.4 / Mac OS X v10.8 (Mountain Lion) or later?
For OS X 10.9, you simply install Xcode. The Command Line Tools are bundled with Xcode. From Technical Note TN2339, Building from the Command Line with Xcode FAQ:
Downloading command-line tools is not available in Xcode for OS X 10.9. How can I install them on my machine?
In OS X 10.9, the Downloads pane of Xcode Preferences does not support
downloading command-line tools. Use any of the following methods to
install command-line tools on your system:
If Xcode is installed on your machine, then there is no need to install
them. Xcode comes bundled with all your command-line tools. OS
X 10.9 includes shims or wrapper executables. These shims, installed
in /usr/bin, can map any tool included in /usr/bin to the
corresponding one inside Xcode. xcrun is one of such shims, which
allows you to find or run any tool inside Xcode from the command line.
Use it to invoke any tool within Xcode from the command line.
...

Xcode Command Line Tools can be installed as a side effect of running git --version in Terminal without Git installed. You will be prompted to install the tools as a requirement for running Git. Apple ships a binary of git with the Command Line tools. This is confirmed on the Git for Mac Download page. This seems like a valid option considering that Homebrew requires the Command Line tools to install Git as well according to another SO post. Otherwise, the previous answers are the most direct methods of install the tools.

Related

Trouble installing Xcode 10.2 beta command line tools and additional tools

I downloaded Xcode 10.2 beta from https://developer.apple.com/download/, unzipped it and moved to the applications folder. I also downloaded "Additional Tools for Xcode 10.2 beta" and "Command Line Tools (MacOS 10.14) for Xcode 10.2 beta" from https://developer.apple.com/download/more/.
Note: This is on a clean install of macOS Mojave 10.14.3
Installation of Additional Tools for Xcode 10.2 beta
I double clicked the "Additional Tools" dmg and it simply opened a Finder window. No installation, just folders with the tools (Audio, Graphics, Hardware, Utilities) and a couple of PDFs. So, I opened the Xcode-beta app and had it automatically trigger the additional tools installation.
Question #1: Is it safe to assume that Xcode-beta would only install the additional tools version that is for 10.2 beta (same as the dmg's version that I downloaded) and not the latest non-beta version?
After Xcode-beta completed installing the additional tools, there was no sign that folders like the ones that appear in the "Additional Tools" dmg had been installed in any directory anywhere.
Question #2 (two parter): (1) If the folders like the ones from the dmg don't appear anywhere after the Xcode-beta triggered installation, what did Xcode-beta install and (2) is there a difference between the additional tools Xcode-beta installs and the additional tools that are on the dmg?
Based on researching installation of Xcode Additional Tools, I tried, after Xcode-beta did its installation, dragging the folders from the "Additional Tools" dmg to the Xcode-beta/Contents/Applications folder (not Xcode-beta/Contents/Developer/Applications). When I ran Xcode-beta after doing this, these folders did appear under the Xcode > Open Developer Tool menu selection, but just the folders, no navigation hierarchy leading to the tools.
Question #3: How do I properly install these folders and tools from the "Additional Tools" dmg?
Installation of Command Line Tools for Xcode 10.2 beta
For the Command Line Tools, I double-clicked the downloaded command line tools dmg and got the "Command Line Tools (macOS Mojave version 10.14).pkg" file. I double-clicked the pkg file and the installation started. But when I got to the step where I click "Install" and enter my password, I get the message:
"The installation failed. The Installer could not install the software. The Installer could not install the software because there was no software found to install."
I downloaded the dmg a second time to make sure I had the complete file, but the result was the same. So, I decided to install the command line tools from the terminal. I ran:
sudo xcode-select --switch /Applications/Xcode-beta.app
followed by
xcode-select --install
The response was:
xcode-select: note: install requested for command line developer tools
And that was it. I then ran:
xcode-select --version
and the response was:
xcode-select version 2354
Question #4 (two parter): (1) Is 2354 indicating the version of command line tools and, if so, (2) is this the same version as the 10.2 beta version I downloaded?
I could not find anything from the Apple Developer download site as to what version number the 10.2 beta Command Line Tools is.
Question #5 (two parter): (1) Have I successfully installed the correct version of the Command Line Tools and, if not, (2) how do I properly install them?
Update #1: Just ran pkgutil --pkg-info=com.apple.pkg.CLTools_Executables and the response was:
package-id: com.apple.pkg.CLTools_Executables
version: 10.1.0.0.1.1539992718
volume: /
location: /
install-time: 1548388461
groups: com.apple.FindSystemFiles.pkg-group
I would think the version should be 10.2.something and that, therefore, xcode-select --install did not install the 10.2 beta version.
Update #2: Just downloaded "Command Line Tools (MacOS 10.14) for Xcode 10.1", double-clicked the pkg file and it installed fine. So, there appears to either be something wrong with 10.2 beta pkg file or some mismatch between it and my system, although as I mentioned, I'm doing this on a fresh install of macOS Mojave 10.14.3. Don't know if issue would still exist if I was using 10.14.2 or earlier.
Update #3: Experimenting, I eventually got an error message like:
... .pkg uses a deprecated pre-10.2 format (or uses a newer format but is invalid)
So I upgraded to macOS 10.14.4 beta (possible "newer format") to see if that would enable me to install the CLT, but same result. There does seem to be a set of command line tools that is installed by default with Xcode that resides in Xcode-beta.app/Contents and they can be selected in Xcode Preferences under "Locations", but they don't appear to be the same tools that would be installed by the downloadable .dmg from the Apple Developer site.
One thing I was able to do is drag the CLT .pkg file to the package utility Pacifist, then in the Content (not Resources) window, right click the top level pkg and select "Install". It does seem to install all of the CLT into /Library/Developer as would be expected. The down sides are, because installing via Pacifist bypasses the "Distribution" .exe file, no receipt is generated (although I don't know if receipts are generated for all .pkg installations or only when installing from the App Store), and no entry is made in the /var/log/install.log file. So, when you run
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
you get:
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
I don't know what the side effects of this would be. If they are minimal or none, perhaps this is the only way to install the downloadable CLT at the moment. This also seems of value only if you have no previous installations of the CLT, because Pacifist isn't able to handle the removal packages that come as part of the installation for previous versions of the CLT.
Update #4: For the downloaded "Additional Tools" .dmg for Xcode 10.2 beta, since it has no installer, just folders, I copied every .app file in the folders to Xcode-beta.app/Contents/Applications and they are all now reachable and executable from the Xcode-beta Xcode > Open Developer Tool menu. The few things that weren't .app files (e.g Network Link Conditioner.prefPane), I copied to Xcode-beta.app/Contents into their original folder names (e.g. Xcode-beta.app/Contents/Hardware/Network Link Conditioner.prefPane). I don't know if this effects their usability or the ability of any of the apps that might need them to reach them, but without any additional guidance, it seemed like a reasonable thing to do for now.
So, on a spectrum that ranges from "This installation process is really lame" to "I'm really dumb", I'm not sure yet where this experience falls. But, beta or not, is the inclusion of basic installation instructions in the release notes asking for too much? (That's perhaps intended to be rhetorical as opposed to Question #6.)
Just an information: in the pkgutil output, at the end of the 'version' line, the long integer is the Unix timestamp for the creation date of the CLT's. For me:
$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 11.0.0.0.1.1567737322
volume: /
location: /
install-time: 1572589224
groups: com.apple.FindSystemFiles.pkg-group
$ date -r 1567737322 +"%d-%b-%Y %T"
06-Sep-2019 04:35:22
$
Switch Command Line Tools to Xcode beta
Once you have install your xcode-beta.
Install your commands line tools like usual, using the following code on your terminal
xcode-select --install
One you have installed commands line tools is the step to download the new ones
To do this, open your browser and look for apple developer resources download
Select view additional downloads, you will need to logIn in order to continue.
Once you have logIn, look for the file you are interested in, in my case was Additional Tools for Xcode 14 beta 5
Select download and wait.
Once is downloaded if you try to open it, you will see the following content on the folder.
It is time to open xcode
Look for xcode<preferences
Search for Locations.
And on command line tools select the ones you just downloaded

Git and Github Mac App incompatibilities?

After I've installed Github Mac app on my macbook (running OSX Mavericks 10.9.2), I've tried to type git on the terminal, and a message appears and say:
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
I've also already installed the "Command Line Tools" from Github Mac app preferences.
So, what is the problem?
Why I can not use the "git" terminal commands and Github Mac client app together?
I've search over the web for solutions, but anyone resolves my problem.
Try running xcode-select --install.
As far as I understand, the command line tools are compilers and other tools needed for development.
For background: prior to Xcode 5, you used to have to download Xcode and within Xcode's preferences choose 'Install Command Line Tools' (or use the command I listed above).
Edit: Corrects the install flag syntax

How can I find out if I have Xcode commandline tools installed?

I need to use gdb.
ps-MacBook-Air:AcoustoExport pi$ gdb
-bash: gdb: command not found
ps-MacBook-Air:AcoustoExport pi$ sudo find / -iname "*gdb*"
Password:
/usr/local/share/gdb
/usr/local/Cellar/isl/0.12.1/share/gdb
:
and:
ps-MacBook-Air:AcoustoExport pi$ ls -la /usr/local/share/gdb
lrwxr-xr-x 1 pi admin 30 14 Jan 22:01 gdb -> ../Cellar/isl/0.12.1/share/gdb
Not quite sure what to make this, clearly it is something installed by homebrew. I don't know why it's there, I don't know whether I could use it instead. It isn't in the search path.
So I figure I need Xcode commandline tools.
Xcode is not currently available from the Software Update server
^ my current problem exactly. Comment on that question says "you can get this error if you have them already"
But how do I check whether I have them already?
/usr/bin/xcodebuild -version
will give you the xcode version, run it via Terminal command
This command allows you to retrieve Xcode version when having only the CommandLineTools version installed:
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version
As per this answer to "Determine xcode command line tools version" on Ask Different
Notes:
Confirmed working on maxOS Sierra and Big Sur.
When only CommandLineTools is install without Xcode, using xcodebuild returns the following error:
# /usr/bin/xcodebuild -version
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
First of all, be sure that you have downloaded it or not. Open up your terminal application, and enter $ gcc if you have not installed it you will get an alert. You can verify that you have installed it by
$ xcode-select -p
/Library/Developer/CommandLineTools
And to be sure then enter $ gcc --version
You can read more about the process here: Xcode command line tools for Mavericks
if you want to know the install version of Xcode as well as Swift
language current version:
Use below simple command by using Terminal:
1. To get install Xcode Version
xcodebuild -version
2. To get install Swift language Version
swift --version
Thanks to the folks on Freenode's #macdev, here is some information:
In the old days before Xcode was on the app-store, it included commandline tools.
Now you get it from the store, and with this new mechanism it can't install extra things outside of the Xcode.app, so you have to manually do it yourself, by:
xcode-select --install
On Xcode 4.x you can check to see if they are installed from within the Xcode
UI:
On Xcode 5.x it is now here:
My problem of finding gcc/gdb is that they have been superseded by clang/lldb: GDB missing in OS X v10.9 (Mavericks)
Also note that Xcode contains compiler and debugger, so one of the things installing commandline tools will do is symlink or modify $PATH. It also downloads certain things like git.
If for some reason xcode is not installed under
/usr/bin/xcodebuild
execute the following command
which xcodebuild
and if it is installed, you'll be prompted with it's location.
I had XCode Commandline Tools installed for sure, but not XCode itself.
None of the available answers to get the version worked. pkgutil didn't give me the package of the XCode Commandline Tools, with none of the suggested package names.
Not having XCode installed (and having no need for it), I could not look in settings dialogs of that either.
xcode-select --version only gave me the version of xcode-select itself, with no clue as to the commandline tools version.
softwareupdate --list told me everything was up to date.
However I knew that my version must be out of date as the installer for one of homebrew packages told me so!
How I finally found out what version of the XCode Commandline Tools is installed I stumbled upon the command:
softwareupdate --history
Which listed 12.3 as the last version it updated...
Display Name Version Date
------------ ------- ----
Safari 14.0 04/11/2020, 12:26:12
Command Line Tools for Xcode 12.1 04/11/2020, 22:38:33
Safari 14.0.2 15/12/2020, 16:38:27
Safari 14.0.1 15/12/2020, 16:38:27
Command Line Tools for Xcode 12.3 15/12/2020, 16:38:27
macOS Big Sur 11.2.1 14/02/2021, 20:57:56
macOS Big Sur 11.2.2 11.2.2 08/03/2021, 09:02:20
So when you know for sure the commandline tools are installed (because, for instance, xcode-select --install tells you so) but none of the other methods works, check softwareupdate --history!
You can open the Xcode app and go to preferences, the last line shows you if you have tools installed, which tools and lets you change them from the drop-down:
If you have installed Xcode but haven't set the Xcode version. then you will be getting this error. To resolve
Xcode-> preferences -> Locations -> command line Tools -> Select the Xcode version
TL;DR
One can have multiple installations of Xcode and multiple installations of Command Line Tools. This is where the system thinks your CLT are
xcode-select --print-path
Options to select Command Line Tools is in Xcode > Preferences > Locations, including the path for each. I found that brew complains about Xcode or Command Line Tools, and so following details how to install specific version of either.
brew doctor issues after upgrade MacOS
I have always used App store to install and update Xcode on my (2014) Macbook Pro but today after all updates brew doctor was still complaining about Xcode
Warning: Your Xcode (12.4) is outdated.
Please update to Xcode 13.2.1 (or delete it).
and complaining about Command Line Tools
Warning: A newer Command Line Tools release is available.
Get the specific version of Xcode
Download a specific version of Xcode as a xip from Developer.apple.com (I downloaded Xcode_13.2.1.xip)
Move Xcode_13.2.1.xip to /Applications
cd Applications
xip --expand /Applications/Xcode_13.2.1.xip
It takes a while to download, then a while longer to validate the application.
Open /Applications/Xcode.app
Check the CLT in XCode
Xcode> Preferences> Locations shows available CLT and the location (path) of each.
Select the appropriate Command Line Tools
Copy the path.
Go to Terminal and use the path in xcode-select
sudo xcode-select -s /Users/<username>/Applications/Xcode.app
Close Terminal and reopen.
The following was not specific enough:
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version
But this is good to identify the version
$ /usr/bin/xcodebuild -version
Xcode 13.2.1
Build version 13C100
IF still showing an older version of CLT
Try
sudo xcode-select --switch /Library/Developer/CommandLineTools/
THEN try
Update to a specific version of CLT
First, remove the existing CLT with
sudo rm -rf /Library/Developer/CommandLineTools
Check which CLT updates available
softwareupdate --list
Software Update Tool
Finding available software
Software Update found the following new or updated software:
Label: Command Line Tools for Xcode-12.4
Title: Command Line Tools for Xcode, Version: 12.4, Size: 440392K,> Recommended: YES,
Label: Command Line Tools for Xcode-13.2
Title: Command Line Tools for Xcode, Version: 13.2, Size: 577329K,> Recommended: YES,
Label: Command Line Tools for Xcode-12.5
Title: Command Line Tools for Xcode, Version: 12.5, Size: 470966K,> Recommended: YES,
Label: Command Line Tools for Xcode-12.5
Title: Command Line Tools for Xcode, Version: 12.5, Size: 470820K,> Recommended: YES,
softwareupdate --install "Command Line Tools for Xcode-13.2"
Closed Terminal and reopen
/usr/bin/xcodebuild -version
Xcode 13.2.1
Build version 13C100
Output from:
$ xcode-select -p
/Users/<username>/Applications/Xcode.app/Contents/Developer
And brew doctor shows
Your system is ready to brew.
For macOS catalina try this : open Xcode. if not existing. download from App store (about 11GB) then open Xcode>open developer tool>more developer tool and used my apple id to download a compatible command line tool. Then, after downloading, I opened Xcode>Preferences>Locations>Command Line Tool and selected the newly downloaded command line tool from downloads.

installed full xcode on mavericks macbook, but homebrew install says command line tools not installed

Installed the full XCODE (about 2 GB) in a brand new mavericks macbook, using App Store, then rebooted. Ran Xcode. Went to Preferences > Location, verified Command Line Tools shows up (v 5.0.2 5A3005).
In terminal, xcode-select -print-path shows /Applications/Xcode.app/Contents/Developer plus I can now run gcc --version and see version info.
So AFAIK command line tools are installed.
However, when I try to install homebrew, it opens the gui dialog offering to install XCode or the command line tools.
I don't want to end up double-installing, with conflicting paths, so any help on why the brew installer isn't "seeing" the commandline tools would be appreciated.
As noted in my comment, it is in fact a homebrew issue that it's not able to find the command line tools 'inside' Xcode due to Xcode recently changing where the command line tools were located... see these two issuesL github.com/Homebrew/homebrew/issues/24471 and github.com/Homebrew/homebrew/issues/20427
The solution was therefore to simply accept the option to install the command line tools when the gui window pops up after homebrew can't find them.

Installing command line tools Xcode 5

I have tried and tried (looked at many headings for this) and I still don't have an answer to my problem. I am trying to install the Pebble SDK 1.12 and install command line tools of Xcode 5.
Everytime I try xcode-select --install in terminal I get "Can't install software because it is not currently available in the Software Update server"
I have tried to reinstall Xcode and that didn't work.
When I got to Xcode-preferences-downloads there isn't a section for the command line tools.
I have also tried installing them from the Developer site but to no avail. The download looks correct and then I go to Xcode to see the preferences and the command line tools aren't listed.
Anything you all can suggest?
Using xcode-select --install in Terminal and choose install tools
On OS X 10.9, the Command Line Tools component no longer appears in the Preferences pane for Xcode 5, unlike on OS X 10.8. Also, the not currently available message appears to be a bug in OS X 10.9 when the currently installed Command Line Tools are already up-to-date. If you have a populated /usr/include directory and /usr/bin/cc --version gives you something, you're probably fine.

Resources