I need to set an env var for an app on MacOs. This is an app that I want to run on startup (currently via Login Items). I can set the env var as a LaunchAgent plist file with the RunAtLoad key set and it will set the env var correctly but on reboot the app starts before this env var is set. If I close the app and restart it, it accepts the env variable.

I have also created a .zshenv file and set it there but have the same issue.

How can I set this env var to be effective for the OS or user session before the app is started via login items?


You must log in to answer this question.

Browse other questions tagged .