sLaunchctl

0.0.2

Alkenso/sLaunchctl

What's New

Improve Service interface

2022-06-23T06:05:06Z
  • add 'info' method with parsed information about the service
  • format code to single code style

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()

Rest functionas is inside sLaunchctl!

Description

  • Swift Tools 5.3.0
View More Packages from this Author

Dependencies

Last updated: Sun Jan 29 2023 05:12:46 GMT-0500 (GMT-05:00)