Launchd works only at logout and not login

I have a UI App, myApp that I launch before login. The app launches when a button on the authorization plugin is clicked. I have acheived this using launchd. When I click the button, I write to a file which is in watchPaths in my launchd plist file. When the file is written to, launchd launches myApp.

I am able to achieve this behaviour during logout-login. But it does not happen on lock-unlock. On clicking the button , the file is written to , but myApp is not launched. I need it achieve the same behaviour at lock-unlock too.

How can I achieve this behaviour at lock-unlock?

The app launches when a button on the authorization plugin is clicked.

It’s not really an app if you run it in a pre-login context. Rather, I’d label this as a pre-login agent. Pre-login agents can be structured like an app but you will hit numerous limitations.

But it does not happen on lock-unlock.

That’s not going to work. Even if you could get your agent to run, it won’t be able to display UI because the screen lock puts up a masking window that prevents anything from showing up on top of it. This is the same reason why a GUI authorisation plug-in can’t show a UI at this time.

The only supported way to present a custom UI during screen lock is with with an SFAuthorizationPluginView. The system arranges to host this a window that lives above the masking window.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Launchd works only at logout and not login
 
 
Q