We are having issues code signing correctly the XPC services that are deployed with our app.
When checking in CLI I see the following
spctl --assess --verbose ./xxxxxx-xpc.xpc
./xxxxxxx-xpc.xpc: rejected (the code is valid but does not seem to be an app)
I really don't know where to take it from here. All targets are set to automatically manage sigining.
There is very little on the web about examples to how to porperly codesign XPC services.
We are using XCode 8.3.3
The XPC services reside in Contents/XPCServices
Can anyone provide some guidance ?
It sounds like you’re butting up against the keychain access control list (ACL). When an app creates an item in the keychain it defaults to having an ACL that only allows that app to access it. If you want other apps to access your item, you need to set the ACL when you create it. The Creating a Custom Keychain Item section of the Keychain Services Programming Guide shows how to do this.
There’s two things to note here:
The code in Listing 3-2 uses the old school
API to create the keychain item. If you’re using the SecItem API you can grab theSecKeychainItemCreateFromContent
function from Listing 3-2 and then pass in the resultingcreateAccess
to yourSecAccessRef
call via theSecItemAdd
attribute.kSecAttrAccess
This technique used to work between arbitrary apps. In recent versions of macOS it only works between apps from the same team. Fortunately that shouldn’t be a problem in your case.
Note One of my colleagues filed a bug (r. 33635514) to get the Keychain Services Programming Guide updated to cover this change.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"