I've found little documentation about this situation as it mostly is focused on XPC in terms of XPC services. My situation is that I have an app, a helper app and a commandline program. The last two reside with in the first app's bundle.
The helper app is not handled by launchd, though may be started as a login item. There are various reasons for this, including the fact that it needs to present UI as well as unique lifecycle/scheduling requirements.
I have been using DO to communicate from the app and commmandline program to the helper. I've been told I could use XPC for this and have done the conversion. The helper has a listener on a mach service name. I am using NS API's, btw, not the xpc_* ones.
There are some problems though:
- It only seems to work if all processes are run or attached from Xcode.
- If any of the end points are run outside of Xcode, any connections are immediately invalidated with no other errors or logs presented.
Based on other articles which touch on this, I'm still not clear if this is a supported configuration and if it isn't, it would be nice to have a definitive answer. Note that all processes are part of the same app bundle. Also, if it isn't supported, it's a bit confusing that it would work within Xcode.
Thanks.