Select Start, select Control Panel. double click System, and select the Advanced tab. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it.
if you're writing a Run Shell Script build phase, you can just do:
PATH=${PATH}:/opt/local/bin
or whatever inside the script content.
This applies for OSX 10.7 and earlier ONLY.
XCode gets its environment variables the same way as other OS X processes, from ~/.MacOSX/environment.plist.
Check developer.apple.com/qa/qa2001/qa1067.html for details on how to set things.
The easiest solution is to add the PATH variable in Xcode.
PATH=${PATH}:/usr/local/bin
In Xcode 5 you can add your PATH as a variable to either a target or the project settings.
+
sign on the top of the pagePATH
and add your preferred value (e.g. /usr/local/bin
for a default install of homebrew. If you are talking specifically about the executable search path environment variable named PATH, then there are a few places that it is set:
~/.cshrc
, ~/.profile
, ~/.bash_profile
, etc.environment.plist
file that was mentioned earlier.gdb
uses. I believe that gdb will read commands from ~/.gdbinit
if it exists.Xcode doesn't look at your shell path environment.
Have a look at NSProcessInfo; and do an NSLog to see what comes up.
If you want a path to apply to all graphical programs you need to set up the ~/.MacOSX/environment.plist. as described.
The recommended way to set the environmen variables are actually in /etc/paths and etc/paths.d although these are also not picked up by Xcode.
I asked about this here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With