views:

243

answers:

1

This is something really simple, but I can't seem to find the answer anywhere, and I'm new to both Mac and UNIX, which doesn't help.

I've installed Xcode on my mac, along with the iPhone SDK 3.2. I'm trying to run Xcode command utilities that came with the SDK from the unix terminal, but I don't know how to update the paths so that the system knows where to find them. Here is what I do.

1) I launch the Terminal application 2) I want to run 'xcrun', so I just type 'xcrun' 3) I get an error saying '-bash: xcrun: command not found' 4) I have xcrun installed under /Developer/usr/bin

Is there some sort of PATHS environment variable that I need to permanently update? Or perhaps Xcode comes with its own Terminal application with those new paths already baked in? Finally, what's the difference between sh and bash?

Thanks for the help!

+2  A: 

I'm using Snow Leopard + Xcode, and xcodebuild and xcrun are both present at /usr/bin. Regardless, they should be present at /Developer/usr/bin -- you just have to make sure that path is in your $PATH variable. You can set it in your shell configuration file (~/.bashrc for bash) like so:

export PATH="/Developer/usr/bin:${PATH}"

As for the difference between sh and bash, bash supports some extensions and other features not found in the more primitive sh; however, on Mac OS X, sh and bash are the same program (this is typical on many Unix and Linux systems nowadays). However, when bash is invoked as sh (that is, you call /bin/sh from the command line, rather than /bin/bash), bash will try to act like the more "traditional" sh program.

mipadi
Thanks for the help - that's exactly the info I was looking for!
durcicko