I have developed a backup application in Java. In it, users can configure whether they want it to autostart or not. If they do, a plist file is being written to ~/Library/LaunchAgents so that my app starts at login. This works perfectly so far.
I've not submitted it to the Mac App Store. But for that, it needed to be sandboxed. And with that, I had to add a "com.apple.security.temporary-exception.files.home-relative-path.read-write=/Library/LaunchAgents/" to my entitlements so that the plist file could still be written to ~/Library/LaunchAgents. However, they do not approve this.
Is there another solution to launch my application at login?
- Must work with sandbox-mode
- Must work from Java/Shell/... (I found "SMAppService", but this seems only available in Swift/Objective-C)
SMAppService
[1] is the only good way to do this in a way that’s compatible with the App Sandbox requirement of the Mac App Store. You’ll need to work out how to call that from your programming language of choice.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Or, if you need to run on older systems, SMLoginItemSetEnabled
.