【发布时间】:2016-10-06 17:36:50
【问题描述】:
我在 stackoverflow 上寻找我的问题的答案并找到了一个线程 (https://superuser.com/questions/229773/run-command-on-startup-login-mac-os-x)。这就是我发现launchd.plist并自己制作了一个:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>js.leapmotion</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>open</string>
<string>/Applications/Utilities/Terminal.app</string>
</array>
<key>LaunchOnlyOnce</key>
<true/>
</dict>
</plist>
这确实在启动我的 mac 后启动了我的终端。但现在我希望它导航到一个目录并在那里运行命令gulp。
这将再次完成其余的工作,打开一个本地主机等等......
所以最后我只需要在特定目录中运行gulp。就这样。如果 launchd.plist 不是最好的方法,那么我愿意接受替代方案。
否则我想知道如何告诉终端它应该运行什么命令。
感谢您的提示。 干杯
J
【问题讨论】:
标签: macos plist startup boot launchd