casouri
V2EX  ›  macOS

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

  •  
  •   casouri · Nov 21, 2017 · 2296 views
    This topic created in 3097 days ago, the information mentioned may be changed or developed.

    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

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3740 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 04:53 · PVG 12:53 · LAX 21:53 · JFK 00:53
    ♥ Do have faith in what you're doing.