目录
目录README.md

sLaunchctl - Swift API to manage daemons and user-agents

Developing for macOS often assumes interaction with root daemons and user agents.
Unfortunately, Apple does not provide any actual API. (Existing SMJobXxx is deprecated)

sLaunchctl fills this gap providing convenient API that wraps up launchctl tool.

Library family

You can also find Swift libraries for macOS / *OS development

  • SwiftConvenience: Swift common extensions and utilities used in everyday development
  • sXPC: Swift type-safe wrapper around NSXPCConnection and proxy object
  • sMock: Swift unit-test mocking framework similar to gtest/gmock

Examples

Bootstrap

try Launchctl.system.bootstrap(URL(fileURLWithPath: "/path/to/com.my.daemon.plist"))
try Launchctl.gui().bootstrap(URL(fileURLWithPath: "/path/to/com.my.user_agent.plist"))

Bootout daemon

try Launchctl.system.bootout(URL(fileURLWithPath: "/path/to/com.my.daemon.plist"))
try Launchctl.gui().bootout(URL(fileURLWithPath: "/path/to/com.my.user_agent.plist"))

List all daemons

let rootDaemons = try Launchctl.system.list()
let user505Agents = try Launchctl.gui(505).list()

Find many more functional inside sLaunchctl!

关于
48.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号