I have Xcode installed, but when I type gcc in terminal I get "command not found". Maybe I messed up the $PATH variable? What is suposed to be the default value?


(...):/ imac2$ echo $PATH


2 Answers 2


You need to install the Xcode command-line developer tools. Open Xcode and go to Xcode → Preferences → Downloads, select the Components tab, and click the button next to “Command Line Tools”.

See Is the installation of Xcode from App Store enough for having the developer tools?.

  • Since I have XCode4, dont I have it installed by default? It was 1.0GB+ download.
    – Ricardo
    Commented Apr 9, 2012 at 16:57
  • In previous Xcode, Command Line Tools used to be installed if you choose Standard Installation (and not Custom installation) when launching the Xcode installer. The latest Xcode is an app that is downloaded and installed by Mac App Store (i.e. no installer) hence no choice to include Command Line Tools during installation. Instead you have to download from within the installed Xcode using the steps (described in my answer). Commented Apr 9, 2012 at 17:10
  • Installing the Command Line Tools. My connection is slow so I wont wait to test it I'll just go ahead and mark your answer as the correct, you were the first. Thanks anyway Global nomad!
    – Ricardo
    Commented Apr 9, 2012 at 17:17

If you installed the latest Xcode 4.3.2, you'll need to download the optional Command Line Tools component before you can use Terminal to access it. To do this,

  1. click on the Preferences… menu
  2. a new window will appear, locate and click the Downloads icon at the top of that window.
  3. In the Components view on the left, click on the Install button on the right to install the Command Line Tools.

After you install it, you should something similar to the following enter image description here


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .