Setting environment variables on OS X

后端 未结 30 3218
你的背包
你的背包 2020-11-21 05:15

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:

30条回答
  •  别跟我提以往
    2020-11-21 05:44

    /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.)

提交回复
热议问题