Last active
February 3, 2018 12:28
-
-
Save mantissa/8231745 to your computer and use it in GitHub Desktop.
Automatically launch OF apps upon system startup ... and restart them on crash (using OSX)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>AllOver.restart</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/Users/user/pathToApp/bin/AppName.app/Contents/MacOS/AppName</string> | |
</array> | |
</dict> | |
</plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// enable the script to launch the app on startup and automatically relaunch after crashing | |
launchctl load /Library/LaunchAgents/KeepAppAlive.plist | |
// disable os crash notification messages | |
defaults write com.apple.CrashReporter DialogType server | |
// suppress os messages to relaunch after crash | |
defaults write -app /Users/user/pathToApp/bin/AppName.app NSQuitAlwaysKeepsWindows -bool false | |
// remove saved state files | |
rm -r /Users/user/Library/Saved\ Application\ State/com.yourcompany.openFrameworks.savedState |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment