What you are looking for is launchd
.
It will allow you to run an app continuously (auto-start at boot, relaunch when it quits/crash)
To use it add a plist
file in ~/Library/LaunchAgents/
<?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>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>SomeApp.restart</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/SomeApp.app/Contents/MacOS/SomeApp</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>5</integer>
<key>Minute</key>
<integer>10</integer>
</dict>
</dict>
</plist>
Then load it once with launchctl load ~/Library/LaunchAgents/SomeApp.restart.plist
- The
RunAtLoad
option will launch the application the first time launchctl runs this.
- The
KeepAlive
option will re-launch the application if it crashes.
- The
StartCalendarInterval
will run it at a certain time. Presumably this is mutually exclusive with the previous two, but is included to show what can be done with launchd
Launchctl will run this after reboots.