plist for /Applications/OneDrive.app to put in /Library/LaunchAgents/ ?

mccallister
Contributor

I want to create a plist file to put in /Library/LaunchAgents folder to have onedrive open for all users. I have tried several times, but I obviously do not know what I am doing when making plists.

Does anyone already have a plist file created for OneDrive they could copy and paste for me?

path to app is /Applications/OneDrive.app

2 REPLIES 2

StoneMagnet
Contributor III

This should do what you want:

<?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.yourorgnamehere.OneDrive.launcher</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/open</string>
        <string>-W</string>
        <string>/Applications/OneDrive.app</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

Save that as a file named com.yourorgname.OneDrive.launcher.plist in /Library/LaunchAgents/ with 644 permissions. (You'll find LaunchControl very handy for manipulating LaunchAgents/Daemons)

mm2270
Legendary Contributor III

It also must be root:wheel for the owner/group in addition to the 644 POSIX permissions.
I second using a utility like LaunchControl (my personal preference) or Lingon X (also good) for creating and manipulating launchd jobs. They are finicky enough that using a tool that takes the guesswork out of setting them up is worth it in my opinion.