How to embed info.plist in privileged helper for SMJobBless?

768 views Asked by At

I try to make helper tool for my app with SMJobBless; when I following the settings with passage :

http://www.tanhao.me/pieces/1623.html/

when I run ,xcode gives me :

SMJobBless Failed, error : Error Domain=CFErrorDomainLaunchd Code=8 "(null)"

8 means kSMErrorJobPlistNotFound; but I have checked Other Link flags:

enter image description here

and the bundle stores the plist:

enter image description here

this is a same question as: SMJobBless error

but I don't under the answer,and I have no permission to add a comment


SMJobBless demo set info.plist key SMPrivilegedExecutables like this; but I don't know how to apply this to my program:

anchor apple generic and identifier "com.apple.bsd.SMJobBlessHelper" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = xxxxxxxxxx)

2

There are 2 answers

0
julia_v On

These files are compiled into your privileged helper, so you need to check their location at compile time. Having them in the bundle won't help with anything.

Check if the paths are correct for the compile time: both plist files should be located in a folder MSLDHelper, which in turn, should be located in the same folder as your .xcodeproj file.

As for the second part of your question: Apple has described their Code Signing Requirements Language in Code Signing Guide. Taking the your example, you should replace the identifier with the one, you use, and replace xxxxxxxxxx with something like "Mac Developer: [email protected] (XXXXXXXXX)". Correct description if your certificate can be found in your Keychain: click twice on your certificate there and copy it's Common Name.

0
Joshua Kaplan On

Based on your screenshot you created a bundle, not a command line tool. SMJobBless only installs standalone command line tool executables. So while your code looks correct for inlining the two property lists into the executable within your bundle, the overall format appears to be entirely wrong.