Skip to content
This repository was archived by the owner on Jun 5, 2024. It is now read-only.

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The package now is part of SwiftSpellbook_macOS

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!

About

No description, website, or topics provided.

Resources

Stars

17 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages