Skip to main content
Question

Help with creating LaunchAgent plist

  • March 22, 2022
  • 4 replies
  • 153 views

Forum|alt.badge.img+6

Hi Everyone

I'm very new to the coding side of MacOs and currently need to create a LaunchAgent for our printer costing app. The app itself is just a normal app that can be manually launched from launchpad or set to auto launch per user, however I need to make sure it runs on every single log in inside our labs. Can someone give me some pointers or help in creating the plist file? I literally just need it to launch "/Applications/Monitor Popup.app" when someone logs in.

Thanks

4 replies

Forum|alt.badge.img+9
  • Contributor
  • March 22, 2022

PaulHazelden
Forum|alt.badge.img+12
  • Jamf Heroes
  • March 22, 2022

You will want something like this. Save it as a plist, with the same name as the unique name you set in it.

The Unique name will need to follow the normal conventions, I found starting it with com.org.app.name works. Have a look at the names used in the LaunchAgents folder.

The Path to the app, might require you to go into the Contents of the app and find the actual launcher in there.

The KeepAlive will ensure that it can't be quit, ever.

When you put the file in place in the LaunchAgents folder it will need to be set to 644 for its permissions. They are fussy about the permissions.

<?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>UNIQUE.NAME.HERE</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/path/to/app/to/launch</string>
</array>
<key>KeepAlive</key>
<true/>
</dict>
</plist>

 


Forum|alt.badge.img+5
  • New Contributor
  • March 22, 2022

I'd do something like this... 

 

 

#!/bin/zsh # open /Applications/Monitor Popup.app at login LAUNCHAGENT=/Library/LaunchAgents/com.launch.Monitor_Popup.app.plist /usr/libexec/PlistBuddy -c "Add :Label string com.launch.Monitor_Popup.app" $LAUNCHDAEMON /usr/libexec/PlistBuddy -c "Add :RunAtLoad bool 1" $LAUNCHDAEMON /usr/libexec/PlistBuddy -c "Add :ProgramArguments array" $LAUNCHAGENT /usr/libexec/PlistBuddy -c "Add :ProgramArguments: string /Applications/Monitor\\ Popup.app" $LAUNCHAGENT​

 

 

 


Forum|alt.badge.img+13
  • Valued Contributor
  • December 21, 2022

Give this a try

https://zerolaunched.herokuapp.com


It looks like https://launched.zerowidth.com/ is the new URL