Pre-Login LaunchAgent on Reboot

I know Pre-Login LaunchAgents are becoming increasingly niche, but I still have one that I support. Sometime around Catalina, it broke to where we have to login with a local user and then logout to get it to display at the LoginWindow. I have updated it to the best of my ability and can force it to display by bootstrapping it to the loginwindow process (launchd), however I still cannot get it to show after a power on or reboot.

I have followed the sample code and again, had it working previously, but something has changed. It is a Cocoa style application primarily in Swift. I do have "canBecomeVisibleWithoutLogin" set to true and it does work in the LoginWindow after bootstrapping it.

After a reboot, I can SSH in and see the application is running and has a PID, but the application window never shows over the LoginWindow.

What am I missing?

Answered by DTS Engineer in 679237022

HOWEVER, after rebooting, the sample code did NOT appear at the loginwindow.

OK. I think I know what’s going on but it’s not something I can help you with here on DevForums. Please open a DTS tech support incident and we can pick things up in that context.

Share and Enjoy

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

I know Pre-Login LaunchAgents are becoming increasingly niche

Hey, I live in that niche!

If you take the PreLoginAgents sample (the Cocoa variant, obviously) and run your test with that, does it still fail?

Share and Enjoy

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

Hey Eskimo! Thanks for the suggestion.
After putting the files in the correct place and logging out, the sample code did appear at the loginwindow.
HOWEVER, after rebooting, the sample code did NOT appear at the loginwindow.

This is not the FileVault loginwindow in case some might be thinking that. I see I didn't address that in the original post so just get that out of the way. Something else I also forgot to mention. My test system is Big Sur 11.2.3. I have not updated it yet to the current version.

Similar to my app, I can SSH in and see the example code has a PID and does appear to be running. It is just not visible at the loginwindow. As soon as I login and log back out, it shows up immediately.

Accepted Answer

HOWEVER, after rebooting, the sample code did NOT appear at the loginwindow.

OK. I think I know what’s going on but it’s not something I can help you with here on DevForums. Please open a DTS tech support incident and we can pick things up in that context.

Share and Enjoy

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

I have a LaunchAgent that calls upon an executable from an Application to run at the Login Window screen.

Is this an app that you created? Or some app from another developer?

Share and Enjoy

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

To anyone stumbling across this post and in the same situation (or any situation really), I opened a ticket and got in touch with Quinn. They are extremely knowledgable and got right to the issue I was having with a solution.

If you are stuck, let The Eskimo guide you out.

Pre-Login LaunchAgent on Reboot
 
 
Q