I have an executable in macOS that I m launching as a User Agent. The same executable can be launched in multiple ways like either user can directly click the exe to launch it, or user can launch it from the terminal using ./ etc. One similar way is when the user launches the exe as a User Agent(i.e daemon in user session).
In this scenarios, I want to identify in my exe If my user has launched it as agent to perform certain task.
I wanted to know how can I accurately determine this?
I have tried figuring out If there is some unique session that agents operate in, but I could not find anything. Can someone help here? Is this even possible?