how to verify if command line tools are installed

0 votes
I am setting up xcode and I need to download and install command line tools. I went to xcode > Preferences > Downloads and I am trying to search for command line tools. But I do not see option to download and install "Command Line Tools". I believe that "Command Line Tools" are already downloaded and installed. How to verify if command line tools are installed?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

answered by
selected by
0 votes
Best answer
10.10 Yosemite Update:
Just enter in gcc or make on the command line! OSX will know that you do not have the command line tools and prompt you to install them!
To check if they exist, xcode-select -p the return value will be 2 if they do NOT exist, and 0 if they do (as well as the directory).
10.9 Mavericks Update:
Use pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
10.8 Update:
Option 1: Rob Napier suggested to use pkgutil --pkg-info=com.apple.pkg.DeveloperToolsCLI, which is probably cleaner.
Option 2: Check inside /var/db/receipts/com.apple.pkg.DeveloperToolsCLI.plist for a reference to com.apple.pkg.DeveloperToolsCLI and it will list the version 4.5.0.
$ defaults read /var/db/receipts/com.apple.pkg.DeveloperToolsCLI.plist
    InstallDate = "2012-12-26 22:45:54 +0000";
    InstallPrefixPath = "/";
    InstallProcessName = Xcode;
    PackageFileName = "DeveloperToolsCLI.pkg";
    PackageGroups =     (
    PackageIdentifier = "com.apple.pkg.DeveloperToolsCLI";
    PackageVersion = "";
    PathACLs =     {
        Library = "!#acl 1\\ngroup:ABCDEFAB-CDEF-ABCD-EFAB-CDEF0000000C:everyone:12:deny:delete\\n";
        System = "!#acl 1\\ngroup:ABCDEFAB-CDEF-ABCD-EFAB-CDEF0000000C:everyone:12:deny:delete\\n";