Closed cameronaaron closed 5 months ago
Here is what I did to achieve this:
Copy the following file contents to ~/Library/LaunchAgents/app.bluebubbles.plist
:
<?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>app.bluebubbles</string>
<key>Program</key>
<string>/Applications/BlueBubbles.app/Contents/MacOS/BlueBubbles</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Note that RunAtLoad
will start this launch agent when loaded (which is determined below) and KeepAlive
, since it is set to true
, will indiscriminately restart BlueBubbles when it exits. As I was researching this, I found that not specifying that the agent should not be restarted when it exits successfully may cause problems with software updates (source), but I haven't had the chance to test this yet.
Disable the built-in autostart:
Install the launch agent and load it after the current user graphically logs in:
launchctl bootstrap gui/$(id -u $(whoami)) ~/Library/LaunchAgents/app.bluebubbles.plist
Immediately start the launch agent (only necessary for the first time):
launchctl kickstart gui/$(id -u $(whoami))/app.bluebubbles
Some additional notes:
launchctl remove app.bluebubbles
launchctl print gui/$(id -u $(whoami))/app.bluebubbles
Thanks @Scr0nch I've turned this into an official guide! https://docs.bluebubbles.app/server/basic-guides/autostart-server-after-crash
I have no clue why this has never worked for me in practice it would still be very nice if this was bundled into the bluebubbles application
I have no clue why this has never worked for me in practice it would still be very nice if this was bundled into the bluebubbles application
I might be able to have the server do it, but it may require admin privileges. I'll have to see.
It probably didn't work for you because the path that he included as the program variable is in the system applications folder. Whole yours is likely in your User applications folder.
Ok i was able to add it as a feature on the server
Thank you!
It would be nice if the install created a launch agent that could allow it to restart it when if it crashes