1

So I need to create a LaunchAgent plist file for my program to run on startup. I have the following text for my plist file but when I try to open the plist file it xCode tells me that the files data isn't in the correct format. Also my program doesn't run on startup and I would assume that the incorrect data format is the problem.

I have looked at everything and it follows my file follows Apples documentation on LaunchAgents.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>Label</key>
   <string>com.coremanager.webhelper</string>
    <key>KeepAlive</key>
   <true/>
   <key>RunAtLoad</key>
   <true/>
   <key>Program</key>
   <string>/Users/schmidt73/Library/Developer/Xcode/DerivedData/Linux-dfoidphusbtywcgykdsujjvymczr/Build/Products/Debug/Linux</string>
</dict>
</plist>

What could I be doing wrong?

schmidt73
  • 181
  • 11
  • I just cut and pasted the above plist into a file and it opened fine in Xcode. `plutil` also thinks it looks fine and was able to convert it to/from a binary plist. – mttrb Jul 10 '14 at 05:24
  • You need to use [`SMLoginItemSetEnabled`](http://blog.timschroeder.net/2012/07/03/the-launch-at-login-sandbox-project/) to launch apps at start up. – GoodSp33d Jul 10 '14 at 05:59
  • @GoodSp33d I solved it because my file had null characters in it ('\0') so my computer would parse it incorrectly. – schmidt73 Jul 10 '14 at 16:23

0 Answers0