sLaunchctl

0.3.2

Alkenso/sLaunchctl

What's New

Adopt latest SwiftSpellbook, bump min macOS to 10.15

2024-01-24T14:54:34Z

Bump min supported macOS to 10.15

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.

Read the article dedicated to the package: sLaunchctl — Swift API to manage Daemons and Agents

Library family

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

  • SwiftSpellbook: 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
  • sEndpontSecurity: Swift wrapper around EndpointSecurity.framework

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!

Description

  • Swift Tools 5.7.0
View More Packages from this Author

Dependencies

Last updated: Sun Mar 24 2024 08:03:49 GMT-0900 (Hawaii-Aleutian Daylight Time)