As I mentioned in this thread https://developer.apple.com/forums/thread/695207 I want my containing app to be active after Mac restarts.
I thought about something that could work - I wrote a "helper" embedded app which will be added to the login items, and after a restart this "helper" app will open the containing app. However, after archiving the project (with developer ID, it will be distributed outside the App Store), I see the following error at the Console:
Non-fatal error enumerating at , continuing: Error Domain=NSCocoaErrorDomain Code=260 "The file “PlugIns” couldn’t be opened because there is no such file." UserInfo={NSURL=PlugIns/ -- file:///Applications/MyMainApp.app/Contents/Library/LoginItems/LauncherApplication.app/Contents/, NSFilePath=/Applications/MyMainApp.app/Contents/Library/LoginItems/LauncherApplication.app/Contents/PlugIns, NSUnderlyingError=0x7fc5cb02c6f0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
I see that there's really no plugin folder, but why? Is it a certificate/signing issue?
The questions: Why I can't see it at the Login Items?The really important question: Even that the app is now at the foreground after Mac restarts, It's not really active - applicationDidFinishLaunching() is not getting called, so I can't listen to notifications from the extension. Any way to make it work?
It sounds like the container app is failing to launch properly and the launching process is not being recognized by the OS as a valid app associated with your project. If you use a helper app or a daemon here it may not be correctly recognized as part of you project and therefore it does not shown up in Security and Privacy properly. Check the following:
- That your helper app or daemon bundle id is super set of your container app's bundle id.
- Check that this helper app or daemon is placed in the correct location inside the bundle as described here.
- Check the code signature on the this helper app / daemon.
Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com