OS X Mountain Lion: Need to reinstall Xcode command line tools

So I upgraded to OS X Mountain Lion yesterday. The install was pretty smooth (though had a tough time with the redeem code for the upgrade, worked on the third code that Apple sent across).

Most of the software is working fine. However, I found that my existing Xcode installation needed an upgrade (via a Xcode install from the App Store).

The problem is that any new Xcode install seems to nuke the command line development tools (think make, autoconf, etc.). The solution is pretty simple though. Once Xcode has been installed, run Xcode and then open the preferences. There is a section on downloads, which lists installing the command line tools as an option.

downloads-2012-07-27-11-51.png

Voila! Issue resolved.

About these ads

13 Comments on “OS X Mountain Lion: Need to reinstall Xcode command line tools”

  1. Thanks. Ran into the same issue. You saved me some time.

  2. John Wooten says:

    I did the same thing ONLY when I look at the download section it says my command line tools are already installed. However, they don’t work. E.g. typing > man cat for instance gives man not found.
    How do I force the reinstall of the command line tools?

    • evolve75 says:

      John,

      Can you check the PATH? It just might be a path setting issue in the shell.

      • John Wooten says:

        I’ve checked. man, cat, grep, sudo aren’t on the computer! I just did a reinstall of Mountain Lion from the HL partition and then XCode allowed me to install the command line tools and it still doesn’t recognize these commands and they aren’t on the computer. Spotlight locates gzip and some others but not these main ones.
        I guess I’m going to try erasing the drive, then recover from Time Capsule as of a couple of days ago when everything was working right. I have no idea how they “went away” or why they aren’t reinstalled.

      • John Wooten says:

        As you suspected, it was a PATH issue. I learned a couple of things here:

        1) Spotlight doesn’t index the /bin and other system areas. For developers sakes, I would like to be able to turn that on for indexing.

        2) When you run port installs, which I had done to install gfortran, it modifies your .bash_profile file in your ~ area. After the install, the profile looks very messy and I noticed an inclusion in the path that I no longer use and while deleting it, I had inadvertently remove the $PATH from the redefinition of the PATH and thus the system information /bin, etc. was lost. I could look up some things like gzip and others I had installed using port and thought erroneously that I could look up cat, sudo, man, etc the same way. Normal unix commands to look things up didn’t work as the commands like find, file, whereis have to be in the path itself to work!

        Thanks for the help.

  3. Dukane says:

    Thanks, though seems like a #fail to not auto-install command-line tools as part of standard XCode install…

  4. Bruce says:

    That GUI is not on Mtn Lion.

  5. Mike Pulice says:

    For some reason I open my xCode prefs and there is no Download section.

    • Mike Pulice says:

      Aye, the app store is telling me xCode is already installed but it is a really old version like 3.6. Isn’t the newer version more like 4.1?

    • evolve75 says:

      Mike,

      The current version of XCode (from the App Store) is 4.6.2. In this version (4.x), the download section has been moved and consolidated under the Components section (in preferences).

      XCode-Components Window

      Hope this helps.

  6. dar263 says:

    i cant find the standard tools in the command utilities


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 81 other followers