I currently have target from type commandlined tool that run as daemon using a plist file under /Library/LaunchDaemons
.
Now I need add it the functionality to receive XPC messages from another process that I have. This Macho file is standalone and runs under application bundle in Resources
subfolder.
I added and implemented the following interface and called it from main
method, but it's enough ?
@interface ServiceDelegate : NSObject <NSXPCListenerDelegate>
ServiceDelegate *delegate = [ServiceDelegate new];
NSXPCListener *listener = [[NSXPCListener alloc] initWithMachServiceName:@"com.macho.scanner"];
[listener resume];
[[NSRunLoop mainRunLoop] run];
The question is whether I can modify my command-line target and add an XPC server, or should I need to create new target from type XPC service, and run it as daemon ?
thanks