【问题标题】:Run plist on wake唤醒时运行 plist
【发布时间】:2017-06-01 00:26:43
【问题描述】:

我一直在搜索,并在launchd 站点找到了选项。有没有办法在机器唤醒时启动.plist?如果这是不可能的,有没有办法在不安装另一个包的情况下运行 shell 脚本而只使用普通 shell?

【问题讨论】:

    标签: shell launchd launchdagent


    【解决方案1】:

    起初它在我的 OSX Sierra mac 上不起作用。重新启动我的机器后,plist 配置现在似乎可以工作了。

    <key>RunAtLoad</key>
    <true/>
    

    此键可确保您的 plist 在唤醒时运行,如果您想指定它将运行哪个脚本,您可以这样做

    <dict>
        <key>PathState</key>
        <dict>
            <key>/path/to/your/shell/script.sh</key>
            <true/>
        </dict>
    </dict>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-09
      相关资源
      最近更新 更多