V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
casouri
V2EX  ›  macOS

推荐大家一个 Python 模块。操作 macOS 上 launchd 文件的

  •  
  •   casouri · 2017-11-21 05:00:12 +08:00 · 1508 次点击
    这是一个创建于 2310 天前的主题,其中的信息可能已经有所发展或是发生改变。

    GitHub: https://github.com/casouri/launchdman

    文档: http://launchdman.readthedocs.io/en/latest/

    使用极其简单:

    # 创建一个 job
    job = launchdman.Job('~/LaunchAgents/com.job.user.plist')
    
    # 添加一些条件
    # Label 和 Program 是必须有的
    job.add(launchdman.Label('job'), launchdman.Program('/usr/local/bin/job'))
    
    # 添加一个 RunAtLoad
    job.add(launcddman.RunAtLoad())
    
    # 写入 plist
    job.write()
    

    更多可用条件参见 launchd 教程: http://www.launchd.info

    更详细的介绍看文档 quick start

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3660 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 04:58 · PVG 12:58 · LAX 21:58 · JFK 00:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.