Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I am a Linux user and have never used OSX before. Someone asked me for help with installing some software on an OSX "Lion" server. I asked him to give me an SSH shell, assuming that would be sufficient. However things are more tricky than I thought.

I wanted to install homebrew, but it didn't install because there was no cc on the system. After some google, I suppose I need to install Xcode. I just downloaded xcode 4.5 from the apple developer site, and mounted it on the system. It contains a dir Xcode.app with a bunch of stuff in it. How do I go from here?

Can I install Xcode without physical access to the machine? All I really want is get homebrew running at this point.

share|improve this question
add comment

2 Answers

up vote 11 down vote accepted

You might be better off just installing the standalone Developer Command Line Tools (which includes gcc and other standard developer toolchain items). You can get it from Apple's Developer Downloads (which requires a free developer account). Unfortunately there's no direct link, but just search for command line tools and you'll find it (note that there are different downloads for Lion and Mountain Lion).

The download is a DMG. Mount that, and you'll find a .mpkg file, which you can install via the command line: sudo installer -pkg "Command Line Tools.mpkg" -target /.

share|improve this answer
+1 for keeping the bare package in mind. +3 for install from terminal - I'll edit my answer down a bit since Xcode is already downloaded, the tools are there in Xcode.app/Contents/Developer and could easily be copied to a convenient path for running. –  bmike Dec 22 '12 at 18:15
Yeah, I'm sure how/if the tools included in the Xcode package differ from the standalone download. Presumably somewhat different given that Xcode has the download tools option as well. In any event, if you're starting from scratch and want a "clean" install doing things from the command line only, this is probably the way to go. –  robmathers Dec 22 '12 at 18:20
I believe the last time I checked, the Xcode tools have extra headers and things for serving the GUI building and the Command Line tools are stripped down a bit / built separately with slightly different flags when compiled, but also generally the same version as major Xcode releases. In practice, I've never seen the differences get noticed let alone matter. AFAIK, Xcode pulls down the package you mentioned and installs it so you have both - the xcrun version of the toolset and the /usr/bin version of the toolset. –  bmike Dec 22 '12 at 18:24
That's good to know. Thanks. –  robmathers Dec 22 '12 at 18:28
Yay it worked. I just installed brew. There is a typo in your post, it should read sudo installer instead of sudo install. –  Jeroen Dec 22 '12 at 19:00
show 1 more comment

The tools you need are all in Xcode.app/Contents/Developer and if you have that folder, you are done installing since OS X applications can run from anywhere.

If you want to use Xcode, just click on the icon or open -a the path to the folder Xcode.app and you will launch the app. Most people move the Xcode.app folder into /Applications (or ~/Applications) to "install it"

Oh - when you fire up Xcode you will want to open the preferences, go to the Downloads pane and install the stand alone command line tools. This places the compilation toolchain in /usr/bin so you don't have to use xcrun --find gcc and xcrun --find make to locate the path to the tools relative to wherever you dropped the Xcode.app folder.

share|improve this answer
Nevertheless Command Line Utilities are also needed to get homebrew to work. It's probably easiest to ask the owner of the OS X system to install the stuff for you (or connect via VNC and do it yourself) –  patrix Dec 22 '12 at 18:12
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.