天天看點

Xcode Command Line ToolsXcode Command Line Tools

Xcode Command Line Tools

Is Xcode Already Installed?

You don’t need the full Xcode package to get the Xcode Command Line Tools. You only need the full Xcode package if you are doing development of applications for the Apple operating systems. However, you may have previously installed the full Xcode package.

Check if the full Xcode package is already installed:

If you see:

/Applications/Xcode.app/Contents/Developer
           

the full Xcode package is already installed.

You will need to update Xcode to the newest version (Xcode 5.01 or newer). Go to the App Store application and check “Updates.” After updating Xcode, be sure to launch the Xcode application and accept the Apple license terms.

Alternatively, you can use a command to install Xcode Command Line Tools. It will produce a similar alert box. Note the double hyphen:

Click “Install” to download and install Xcode Command Line Tools.

The instructions in the alert box are confusing. You don’t need to “Get Xcode” from the App Store. Just click “Install” for the Xcode Command Line Tools.

downloading Xcode Command Line Tools

installed Xcode Command Line Tools

Verify that you’ve successfully installed Xcode Command Line Tools:

/Library/Developer/CommandLineTools

Just to be certain, verify that gcc is installed:

Configured with: –prefix=/Library/Developer/CommandLineTools/usr –with-gxx-include-dir=/usr/include/c++/4.2.1

Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)

Target: x86_64-apple-darwin14.0.0

Thread model: posix

On earlier versions of Mac OS X, it was more difficult to install Xcode Command Line Tools. It required a huge download of the full Xcode package from the Mac App Store or registration as an Apple developer for a smaller Command Line Tools package. Mac OS X Mavericks made installation of Xcode Command Line Tools much simpler.

Alternatives

The OSX GCC Installer is an open source project to provide the GCC compiler and related tools. In a recent blog post, Xcode, GCC, and Homebrew, the project maintainer recommends installing the Xcode Command Line Tools because the open source project is unable to duplicate the complete Apple package (notably, the Node software project isn’t supported).

Start Coding!

With the GCC compiler installed, you can install any Unix system tools you need for software development.

To install Rails, see the article Install Ruby on Rails – Mac OS X.

Want to learn Ruby on Rails? See What is Ruby on Rails?, the book Learn Ruby on Rails, and recommendations for a Rails tutorial.

繼續閱讀