(PrefPane project xcode version 4 Build 4A304a)
SMJobBless(kSMDomainSystemLaunchd, @"com.coderama.coderamaHelper", authRef, &err);
System Preferences[22312:903] Bless Error: Error Domain=kSMErrorDomainFramework Code=5 UserInfo=0x2005790e0 "The operation couldn’t be completed. (kSMErrorDomainFramework error 5 - The tool at the specified path is not valid.)"
Below are my plists.
Can anyone decipher the error message so I can attempt to troubleshoot this? I have gone over all of my plists to make sure the names match-up.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.coderama.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 coderama. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>coderama</string>
<key>NSPrefPaneIconFile</key>
<string>show_wireframe_zoom_24.gif</string>
<key>NSPrefPaneIconLabel</key>
<string>coderama</string>
<key>NSPrincipalClass</key>
<string>coderama</string>
<key>SMPrivilegedExecutables</key>
<dict>
<key>com.coderama.coderamaHelper</key>
<string>identifier com.coderama.coderamaHelper and certificate leaf[subject.CN] = "Joe Developer"</string>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>com.coderama.coderamaHelper</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>coderamaHelper</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>SMAuthorizedClients</key>
<array>
<string>identifier com.coderama.coderama and certificate leaf[subject.CN] = "Joe Developer"</string>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.coderama.coderamaHelper</string>
<key>MachServices</key>
<dict>
<key>com.coderama.coderamaHelper.mach</key>
<true/>
</dict>
</dict>
</plist>
I went to this error too, at first check again the steps declared in the readme.txt of the SMJobless project:
Finally make sure that THE DAEMON is embedded in the executable itself before Build it, this is accomplished by this way: In the helper tool or daemon go to target/Build Settings/Linking/Other Linker Flags and add the following:
-sectcreate
__TEXT
__info_plist
MyDaemon/info.plist
-sectcreate
__TEXT
_launchd_plist
MyDaemon/myDaemon-launchd.plist
Make sure to replace MyDaemon for the correct values of your own development. Be careful with the names of your info and launchd files.
IMPORTANT TIP: THE NAME OF THE DAEMON OR SERVICE MUST CORRESPOND TO THE SAME NAME WRITTEN IN THE INFO.PLIST AND LAUNCHD.PLIST FILES OTHERWISE IT WILL GENERATE THE ERROR kSMErrorDomainFramework
error 5 - The tool at the specified path is not valid.
An Apple developer replied to me stating that SMJobBless
only works with Applications only.
This error occurs when the helper tool is not bundled in the correct location, and so SMJobBless()
can't find the tool for installation. In the Build Phases
section of your main application target, you have to add a Copy Files
build phase. Add your helper tool, set the destination to Wrapper
and the subpath to Contents/Library/LaunchServices
, and SMJobBless()
will be able to find your helper tool.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With