Running an application as a Daemon

I am building a macOS application and would like to check if the application is running in the background or not. Was referring documentation for the same and found few links under 'Archives'. Below is the document I could get: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/DesigningDaemons.html

Is there some latest documentation available on this subject ? Any pointers would be helpful.

Thanks in advance.

Replies

Well with Activity Monitor you could off course check if a daemon is running.

You could also check it with code, for example in the container app which you use to distribute the daemon.

let runningApps = NSWorkspace.shared.runningApplications
let isRunning = runningApps.contains {
    $0.bundleIdentifier == "your-daemon-bundle-id"
}