What is the proper way to modify environment variables like PATH in OS X?
I\'ve looked on Google a little bit and found three different files to edit:
/etc/launchd.conf is not used in OS X v10.10 (Yosemite), OS X v10.11 (El Capitan), macOS v10.12 (Sierra), or macOS v10.13 (High Sierra).
From the launchctl
man page:
/etc/launchd.conf file is no longer consulted for subcommands to run during early boot time;
this functionality was removed for security considerations.
The method described in this Ask Different answer works for me (after a reboot): applications launched from the Dock or from Spotlight inherit environment variables that I set in ~/Library/LaunchAgents/my.startup.plist
. (In my case, I needed to set LANG
, to en_US.UTF-8
, for a Sublime Text plugin.)