XPC service won't start

I have written several applications that utilise a few XPC services that I include in each application bundle.


For some unknown reason, one particular application is refusing to communicate with its XPC services. It seems that they don't even get started by launchd. The XPC bundles are properly signed and the main application bundle is fully deployed and signed such that codesign --verify --deep says that the app bundle is valid on disk and satisfies its designated requirement.


I know the XPC services themselves are fine because they work when deployed in other applications.


There is no command line or console output to show an issue.

I guess something, somewhere is not signed but I can't find what.


How can I find out why launchd won't start the services ?

And is there a checklist I can go through to ensure that launchd is happy with the file set up ?

Answered by lyndonh in 92830022

It turns out that the property list for the main application bundle was the source of the problem: I had updated it recently and somehow managed to write an old style ASCII property list - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/PropertyLists/OldStylePlists/OldStylePLists.html#//apple_ref/doc/uid/20001012-BBCBDBJE


The solution was to generate a new style XML property list.

To start, try it on a different machine, preferably a freshly installed one (I use a VM for this sort of thing). That’ll let you tell whether the problem is with your app or the system you’re running it on.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for the reply, I have already tried that (I have a multiboot set up so I can test with different versions of OSX).

Running on another partition, I eventually managed to find a relevant error message, although this message isn't produced every time the problem is encountered:


launchd: Could not resolve origin of domain. XPC services in this domain's bundle will not be bootstrapped: error = 109: Invalid property list, taint = (null)



When I check the Info.plist for one of my XPC services bundle I have the following properties set:


LSBackgroundOnly = true

NSHumanReadableCopyright = blahblahblah

CFBundleInfoDictionaryVersion = 6.0

CFBundlePackageType = XPC!

CFBundleVersion = 1

CFBundleIdentifier = com.mydomain.subdomain.application

CFBundleExecutable = com.mydomain.subdomain.application

XPCService/JoinExistingSession = true

XPCService/ServiceType = Application


This is what I was using prior to having problems and is identical to the other applications that use the same XPC services.

Accepted Answer

It turns out that the property list for the main application bundle was the source of the problem: I had updated it recently and somehow managed to write an old style ASCII property list - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/PropertyLists/OldStylePlists/OldStylePLists.html#//apple_ref/doc/uid/20001012-BBCBDBJE


The solution was to generate a new style XML property list.

XPC service won't start
 
 
Q