Post

Replies

Boosts

Views

Activity

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?
1
0
830
Mar ’23
launchd that runs a console app from authenticator
I have an authentication app (authApp) that runs on Mac. AuthApp lets you log in to the Mac. It runs in place of the default login screen. I have added a new button in authApp and I want that button to launch another app (let's call it newApp) when clicked. AuthApp is written in Objective-C and newApp in Swift. I am able to launch newApp from the login screen every time at logout with the help of launchd agents. But that is not what I want; I want it to open only when the button in AuthApp is clicked. This is my launchd plist `<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.example.apple-sample</string> <key>LimitLoadToSessionType</key> <string>LoginWindow</string> <key>KeepAlive</key> <true/> <key>ProgramArguments</key> <array> <string>/Library/PrivilegedHelperTools/newApp.app/Contents/MacOS/newApp</string> </array> </dict> </plist>` The file is saved in /Library/LaunchAgents. newApp is in /Library/PrivilegedHelperTools. Is there a way to execute this launchd programmatically (Objective-C++/Swift) from the code so that newApp is launched? Please note this needs to be done before the user has logged in to the machine.
7
1
1.1k
Jan ’23
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?
Replies
1
Boosts
0
Views
830
Activity
Mar ’23
launchd that runs a console app from authenticator
I have an authentication app (authApp) that runs on Mac. AuthApp lets you log in to the Mac. It runs in place of the default login screen. I have added a new button in authApp and I want that button to launch another app (let's call it newApp) when clicked. AuthApp is written in Objective-C and newApp in Swift. I am able to launch newApp from the login screen every time at logout with the help of launchd agents. But that is not what I want; I want it to open only when the button in AuthApp is clicked. This is my launchd plist `<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.example.apple-sample</string> <key>LimitLoadToSessionType</key> <string>LoginWindow</string> <key>KeepAlive</key> <true/> <key>ProgramArguments</key> <array> <string>/Library/PrivilegedHelperTools/newApp.app/Contents/MacOS/newApp</string> </array> </dict> </plist>` The file is saved in /Library/LaunchAgents. newApp is in /Library/PrivilegedHelperTools. Is there a way to execute this launchd programmatically (Objective-C++/Swift) from the code so that newApp is launched? Please note this needs to be done before the user has logged in to the machine.
Replies
7
Boosts
1
Views
1.1k
Activity
Jan ’23