How can I get Xcode to install under Lion?

I'm slightly confused under Lion as to how to get dependencies in place for Homebrew. It wants Xcode in place, and I can go to the app store and click on "Install", and it dutifully says "Installing"... and stays stuck on "Installing" after several minutes. I can find Xcode but apparently not get to "Installed", in the past indicative.

How can I install Xcode? Do I just need to give it more time to install? Or is there another way like installing from tarball? It's been "Installing" for a few minutes, and seems stuck.


Solution 1:

When the App Store is "Installing" keep in mind this includes "Downloading", and Xcode is usually about 4 GB. Leave it overnight or monitor your network traffic to see the progress.

Once Xcode is installed, you will need to run xcode-select to expand your path since tools like make and compilers/linkers are in /Applications/Xcode and not in your typical bash path. You can go to settings and download the command line tools to keep them if decide to delete Xcode later.

Solution 2:

While this doesn't actually answer your direct question of Xcode on Lion, if you are only needing part of it for homebrew, Xcode 4.3 split many of the other parts of Xcode off into separate different downloads.

If you only need the command line tools for homebrew and the like, you no longer need to install all of Xcode. Here is another link as well.

Otherwise, Apple used to allow downloads of Xcode from the Dev center, but most of this is driven through the App Store now.

Finally, Xcode is a rather large application, and the installation is unique too. Make sure that another window hasn't opened waiting for input on the installation, etc. It also may take a long time to download, which should be noted in the App Store on its progress.