Mac OS X 上的每个应用程序环境变量
有多种不同的方式记录了系统范围或每个用户设置环境变量的方法,请参阅 此问题。
是否有任何选项可以为每个应用程序设置环境变量?
例如,有没有办法使用 ~/.MacOSX/environment.plist
或 launchd.conf
之类的东西,但有一些变量仅由特定应用程序继承?
我能想到的唯一方法是修改每个应用程序的 Info.plist,但这涉及更改应用程序包,这似乎不是一个非常好的主意。
There are several different ways documented of setting environment variables either system wide or per user, see this question.
Are there any options for setting environment variables on a per-application basis?
E.g. Is there a way to use something like ~/.MacOSX/environment.plist
or launchd.conf
but have some variables only inherited by specific apps?
The only way I can think of is to modify each applications Info.plist, but this involves changing an applications bundle which doesn't seem like a terribly good idea.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,这是通过将所需的应用程序包装在一个小的 shell 脚本或自动操作中来设置环境变量然后启动应用程序来完成的。例如,我有一个自动化器“应用程序”,它具有以下规则:
当我想以这种方式启动它时,我只需运行自动化器操作。
Typically this is done by wrapping the desired app in a small shell script or automator action that sets the environment variable and then launches the app. For example, I have an automator "application" that has the following rule:
When I want to launch it this way, I just run the automator action.