我在任何 header 中都找不到 CFErrorDomainLaunchd。我用的是 find 命令用于 grep 10.11 SDK 中的每个头文件。
我也尝试过谷歌:
site:opensource.apple.com CFErrorDomainLaunchd
当我尝试安装我的帮助应用程序时,SMJobBless 将错误传回 及其 launchd plist。
我很困惑,因为安装运行得很好 昨天。我特此决定更频繁地检查我的代码 比我现在做的还要多。
Boolean success;
CFErrorRef error;
success = SMJobBless(
kSMDomainSystemLaunchd,
CFSTR("com.frescologic.FL2000.Uninstaller.UninstallerHelper"),
self->_authRef,
&error ); <-- This is CFErrorDomainLaunchd error 2
我永远欠你的情。
我正在开发 - 或尝试开发 - 驱动程序的卸载程序。它还会卸载用户空间程序以及 OS X 用于启动或停止该用户空间程序的 LaunchAgent plist。
最佳答案
一般表示找不到LaunchAgent。确保有一个构建阶段来复制目标类型为“Wrapper”且子路径为 Contents/Library/LaunchServices 的 Helper。还要确保产品名称与 plist 文件中使用的 bundle ID 相匹配。
例如:
<key>SMPrivilegedExecutables</key>
<dict>
<key>com.keenow.HelperTool</key>
<string>anchor apple generic and identifier "com.myapp.HelperTool" 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] = "YourTeamId")</string>
</dict>
关于macos - 什么是 CFErrorDomainLaunchd 错误 2?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48433300/