In previous releases of OS X (Mavericks, Mountain Lion, Lion, ...), environment variables are configured in the /etc/launchd.conf file.
As of OS X Yosemite, this is no longer working. To configure environment variables, you can do the following
$ nano ~/Library/LaunchAgents/my.startup.plist
my.startup.plist
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "<a href="http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist">http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist</a> version="1.0"> <dict> <key>Label</key> <string>my.startup</string> <key>ProgramArguments</key> <array> <string>sh</string> <string>-c</string> <string>launchctl setenv $VARIABLE_NAME $VARIABLE_VALUE</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>
Add new comment