I'd like to get an indication about the context in which my process is running from. I'd like to distinguish between the following cases :
- It runs as a persistent scheduled task (launchDaemon/launchAgent)
- It was called on-demand and created by launchd using
opencommand-line or double-click. - It was called directly from command-line terminal (i.e.
> /bin/myProgfrom terminal )
Perhaps is there any indication about the process context using Objective-c/swift framework or any other way ? I wish to avoid inventing the wheel here :-)
thanks