How to get XCode to use bash environment variables.
From ohad@21:1/5 to All on Fri Oct 23 02:49:25 2015
A couple of comments for future readers:
1. bash environment variables (export FOO=BAR) will work if XCode is started from the same bash session (open -a xcode)
2. In order to set environment variables that are available to GUI aplications, starting from Mountain Lion launchctl should be used: http://codepulsive.blogspot.com.au/2013/11/setting-environment-variables-in-os-x.html
3. In order to use environment varialbes in XCode 7, the following command must be issued: defaults write com.apple.dt.Xcode UseSanitizedBuildSystemEnvironment -bool NO