Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

how to verify if command line tools are installed

Solved 1 Answers 384 Views Others
0 1
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?

1 Answer

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
10.8 Update:
Option 1: Rob Napier suggested to use pkgutil, which is probably cleaner.
Option 2: Check inside /var/db/receipts/ for a reference to and it will list the version 4.5.0.
$ defaults read /var/db/receipts/
    InstallDate = "2012-12-26 22:45:54 +0000";
    InstallPrefixPath = "/";
    InstallProcessName = Xcode;
    PackageFileName = "DeveloperToolsCLI.pkg";
    PackageGroups =     (
    PackageIdentifier = "";
    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";
answered by
selected by

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.