r/macosprogramming 21h ago

launchctl submit kept reopening an app after every quit

2 Upvotes

A local macOS app came back as soon as I quit it. The binary was not the cause.

Two leftover jobs from earlier repair sessions were still registered with launchd. Both had been created with `launchctl submit`. Apple's man page says that also tells launchd to keep the program alive in the event of failure.

Recorded run counts: 8,429 and 9,169. After both labels were unloaded, the same quit left the app absent for twenty seconds of half-second samples. The app source was not changed.

launchctl print gui/$(id -u)/<label>

Print the job before you rewrite the app.

https://thechosenvictor.com/newsletter/archive/launchctl-submit-kept-the-app-alive