OS X Command-line Dev Tools—Install Shortcut

12 Nov

Xcode command-line toolsAmong those around me, in world of tech startups (even in the vicinity of the world of Windows), MacBooks are used almost universally. I can’t explain the discrepancy between what I see around me and the data you usually read; but I do know that as a technical platform, OS X provides an easier path to development tools. These days, the world driven by web-based applications. A majority of those applications run on Linux-based machines. OS X shares with Linux, a common ancestor, Unix. So, a robust array of common commands come with OS X—ssh, ftp, bash, vi, emacs, etc. But more importantly, OS X comes pre-installed with hottest development tools used for web development, today—Ruby, Python, PHP, Apache, memcache, etc. This means a developer can write web applications without even being connected to the Internet!

There are more tools available with the free download of Xcode, Apple’s integrated development environment (IDE) for OS X and iOS. Xcode provides exclusive tools for developing applications for OS X and iOS. More than that is can make additional commands available to command-line, that are generally useful for development, even outside Apple app development—git, svn, gcc, etc. There are three ways to access these tools:

  1. Download and install, from within Xcode, the huge “Command Line Tools”.  This is big and tedious.
  2. Prefix the desired command with xcrun, as in:
    [bash light=”true”]
    xcrun git clone
    [/bash]An alias can be created to use this in its more familiar form,[bash light=”true”]
    alias git=’xcrun git’
    git clone

    But this has side-effects (scripts that rely on its native access as a command may not work).

  3. Add the path to the commands installed within Xcode to the execution path:

    [bash light=”true”]
    export PATH=$PATH:/Applications/

Note that some of the tools (e.g,. Ruby) are rather old and may need to be updated, depending on your needs.—at least there is something to start with. The downside is that Apple does not provide those updates. I can document those steps—if you are interested, let me know.

The question is, why spend the time and disk-space to download and install the full Command Line Tools when a simple PATH update is all that is needed?


Tags: , , , , , , , , , , , ,