
If these apps were partially ported to the Mac, or ported circa MacOS X 10.3 or something, then they are just wrong. You could have multiple versions of the software installed and just run "start_app.sh" and it would bootstrap according to where you launched it from.īut that is how it is supposed to work in Linux, Solaris, and X. You would have a shell script "start_app.sh" or something and it would define all the environment variables you would need and launch the GUI via X. Or at least, that was how we used to do it back in Solaris days. How were those apps ported? If they are X11 apps, then you would set the environment variables with a wrapper, the same way you would do it on Linux.

Sudo launchctl config user path /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/me/mydir The "launchctl config" command seems to allow PATH to be set (after a reboot) for GUI apps, but it doesn't appear to work for the terminal. It has one other slight issue, in that it doesn't seem to work for applications that are reopened at login, if "Reopen windows when logging back in" is checked

This seems to work ok for environment variables other than PATH, for GUI and local shells, but not ssh. E.g.Ĭreate file: /Library/LaunchAgents/istĪnd load with: launchctl load /Library/LaunchAgents/ist It seems possible to set some environment variables globally using launchctl and a plist. Editing /etc/paths and /etc/paths.d/ - this only seems to apply to command line apps. Setting the variables in ~/.bash_profile - this only seems to apply to command line apps. It should work with System Integrity Protection enabled

It should work for both local shell and also remote SSH shells

It should work for both GUI + command line applications. A method that works from Yosemite and later versions of the OS What is the recommended and most compatible way to set the PATH and other environment variables globally? I would like:
