Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ macOS程序在由自己生成的证书签名时崩溃,但没有签名_C++_Macos_Qt5_Code Signing - Fatal编程技术网

C++ macOS程序在由自己生成的证书签名时崩溃,但没有签名

C++ macOS程序在由自己生成的证书签名时崩溃,但没有签名,c++,macos,qt5,code-signing,C++,Macos,Qt5,Code Signing,我生成了自己的测试证书。我使用 find cmake-build-release/Beertabs.app -name "*.dylib" | xargs -I $ codesign --verify --verbose --sign $1 $ find cmake-build-release/Beertabs.app -name "*.framework" | xargs -I $ codesign --verify --verbose --sign $

我生成了自己的测试证书。我使用

find cmake-build-release/Beertabs.app -name "*.dylib" | xargs -I $ codesign --verify --verbose --sign $1 $
find cmake-build-release/Beertabs.app -name "*.framework" | xargs -I $ codesign --verify --verbose --sign $1 $
codesign --sign $1 --verbose --entitlements Beertabs-Entitlements.plist cmake-build-release/Beertabs.app
其中$1是我的密钥名

当试图运行该程序时,它会立即崩溃。控制台在底部显示输出。当我运行
codesign-vvv cmake build release/Beertabs.app
来验证代码签名时,一切都被验证了。但是,当我运行
spctl--verbose=4--assessment--type execute-cmake-build-release/Beertabs.app
时,我得到
cmake-build-release/Beertabs.app:rejected

程序在没有代码签名的情况下按预期运行,但无法使用它。有没有我错过的一步?应该提到的是,我正在使用Qt库,并使用
macdeployqt
工具将库文件捆绑到appbundle中。发生这种情况是因为我使用的是自签名证书吗

default 15:48:48.762073-0500    lsd - 45683955: Checking whether application is managed at file:///Users/rwardrup/Projects/Beertabs/cmake-build-release/Beertabs.app/
default 15:48:48.792781-0500    Finder  LAUNCHING:0x0-0x27e67e4 Beertabs foreground=1 bringForward=1 seed=8974 userActivityCount=0
default 15:48:48.803196-0500    loginwindow -[ApplicationManager checkInAppContext:eventData:] | ApplicationManager: Checked in app : Beertabs
default 15:48:48.843811-0500    secinitd    Beertabs[71467]: root path for bundle "<private>" of main executable "<private>"
default 15:48:48.853615-0500    runningboardd   Resolved pid 71467 to [executable<Beertabs(501)>:71467]
default 15:48:48.855505-0500    runningboardd   [executable<Beertabs(501)>:71467] This process will not be managed.
default 15:48:48.855541-0500    runningboardd   Now tracking process: [executable<Beertabs(501)>:71467]
default 15:48:48.856161-0500    runningboardd   Acquiring assertion targeting executable<Beertabs(501)> from originator [daemon<com.apple.coreservices.launchservicesd>:145] with description <RBSAssertionDescriptor; foregroundApp:71467; ID: 307-145-25866; target: 71467> attributes = {
    <RBSDomainAttribute: 0x7f81f8521400; domain: com.apple.launchservicesd; name: RoleUserInteractiveNonFocal; sourceEnvironment: 0x0>;
}
default 15:48:48.856360-0500    runningboardd   Assertion 307-145-25866 (target:executable<Beertabs(501)>) will be created as active
default 15:48:48.857615-0500    runningboardd   Acquiring assertion targeting executable<Beertabs(501)> from originator [daemon<com.apple.coreservices.launchservicesd>:145] with description <RBSAssertionDescriptor; foregroundApp:71467; ID: 307-145-25867; target: 71467> attributes = {
    <RBSDomainAttribute: 0x7f81fab493f0; domain: com.apple.launchservicesd; name: RoleUserInteractiveNonFocal; sourceEnvironment: 0x0>;
}
default 15:48:48.858001-0500    runningboardd   [executable<Beertabs(501)>:71467] Ignoring jetsam update because this process is not memory-managed
default 15:48:48.857958-0500    runningboardd   Assertion 307-145-25867 (target:executable<Beertabs(501)>) will be created as active
default 15:48:48.858454-0500    runningboardd   [executable<Beertabs(501)>:71467] Ignoring resume because this process is not lifecycle managed
default 15:48:48.858603-0500    runningboardd   Finished acquiring assertion 307-145-25866 (target:executable<Beertabs(501)>)
default 15:48:48.858815-0500    runningboardd   [executable<Beertabs(501)>:71467] Set darwin role to: UserInteractiveNonFocal
default 15:48:48.859493-0500    runningboardd   [executable<Beertabs(501)>:71467] Ignoring GPU update because this process is not GPU managed
default 15:48:48.859719-0500    runningboardd   Finished acquiring assertion 307-145-25867 (target:executable<Beertabs(501)>)
default 15:48:48.859733-0500    runningboardd   Invalidating assertion 307-145-25866 (target:executable<Beertabs(501)>) from originator 145
default 15:48:48.909969-0500    secinitd    Beertabs[71467]: root path for bundle "<private>" of main executable "<private>"
default 15:48:50.002388-0500    secinitd    Beertabs[71467]: root path for bundle "<private>" of main executable "<private>"
default 15:48:51.097233-0500    secinitd    Beertabs[71467]: root path for bundle "<private>" of main executable "<private>"
default 15:48:52.184767-0500    secinitd    Beertabs[71467]: root path for bundle "<private>" of main executable "<private>"
default 15:48:52.222575-0500    runningboardd   [executable<Beertabs(501)>:71467] Death sentinel fired!
default 15:48:52.222934-0500    ReportCrash Parsing corpse data for process Beertabs [pid 71467]
default 15:48:52.228765-0500    runningboardd   Invalidating assertion 307-145-25867 (target:executable<Beertabs(501)>) from originator 145
default 15:48:52.330990-0500    runningboardd   Removing process: [executable<Beertabs(501)>:71467]
default 15:48:52.339950-0500    runningboardd   Removing assertions for terminated process: [executable<Beertabs(501)>:71467]
default 15:48:54.130670-0500    ReportCrash Sending event: com.apple.stability.crash {"appVersion":"???","bundleID":"","exceptionType":2,"process":"Beertabs","responsibleApp":"Beertabs"}
default 15:48:54.130903-0500    analyticsd  Received event: com.apple.stability.crash {"appVersion":"???","bundleID":"","exceptionType":2,"process":"Beertabs","responsibleApp":"Beertabs"}
default 15:48:54.131016-0500    analyticsd  Aggregated. Transform: StabilityCrashNumerator3 Dirty: 6 Event: com.apple.stability.crash {"appVersion":"???","bundleID":"","exceptionType":2,"process":"Beertabs","responsibleApp":"Beertabs","timestamp":1600289334130405}
default 15:48:54.131108-0500    analyticsd  Aggregated. Transform: StabilityCrashNumerator3WithIncidentID Dirty: 6 Event: com.apple.stability.crash {"appVersion":"???","bundleID":"","exceptionType":2,"process":"Beertabs","responsibleApp":"Beertabs","timestamp":1600289334130405}
default 15:48:54.174021-0500    ReportCrash Saved crash report for Beertabs[71467] version ??? (???) to Beertabs_2020-09-16-154854_Rivendell.crash
default 15:48:54.205327-0500    ReportCrash Removing excessive log: Beertabs_2020-09-16-154854_Rivendell.crash
default 15:48:48.762073-0500 lsd-45683955:检查应用程序是否在file:///Users/rwardrup/Projects/Beertabs/cmake-build-release/Beertabs.app/
默认15:48:48.792781-0500 Finder启动:0x0-0x27e67e4 Beertabs前台=1 bringForward=1种子=8974 userActivityCount=0
默认值15:48:48.803196-0500登录窗口-[ApplicationManager checkInAppContext:eventData:]| ApplicationManager:签入应用程序:Beertabs
默认值15:48:48.843811-0500 secinitd Beertabs[71467]:主可执行文件的捆绑包“”的根路径
默认15:48:48.853615-0500 RunningBoard将pid 71467解析为[可执行文件:71467]
默认15:48:48.855505-0500 runningboardd[可执行文件:71467]将不管理此进程。
默认15:48:48.855541-0500 RunningBoard立即跟踪进程:[可执行文件:71467]
默认15:48:48.856161-0500 runningboardd获取来自发起人[daemon:145]的以可执行文件为目标的断言,描述属性={
;
}
默认15:48:48.856360-0500 RunningBoard断言307-145-25866(目标:可执行文件)将创建为活动
默认15:48:48.857615-0500 runningboardd获取来自发起人[daemon:145]的以可执行文件为目标的断言,描述属性={
;
}
默认15:48:48.858001-0500 runningboardd[可执行文件:71467]忽略jetsam更新,因为此进程不是内存管理的
默认15:48:48.857958-0500 RunningBoard断言307-145-25867(目标:可执行文件)将创建为活动
默认15:48:48.858454-0500 runningboardd[可执行文件:71467]忽略恢复,因为此进程不是生命周期管理的
默认15:48:48.858603-0500 RunningBoard已完成获取断言307-145-25866(目标:可执行)
默认值15:48:48.858815-0500 runningboardd[可执行文件:71467]将darwin角色设置为:UserInteractiveInfo
默认15:48:48.859493-0500 runningboardd[可执行文件:71467]忽略GPU更新,因为此进程不是GPU管理的
默认15:48:48.859719-0500 RunningBoard已完成获取断言307-145-25867(目标:可执行)
默认15:48:48.859733-0500 runningboardd使发起者145的断言307-145-25866(目标:可执行文件)无效
默认值15:48:48.909969-0500 secinitd Beertabs[71467]:主可执行文件的捆绑包“”的根路径
默认值15:48:50.002388-0500 secinitd Beertabs[71467]:主可执行文件的捆绑包“”的根路径
默认值15:48:51.097233-0500 secinitd Beertabs[71467]:主可执行文件的捆绑包“”的根路径
默认值15:48:52.184767-0500 secinitd Beertabs[71467]:主可执行文件的捆绑包“”的根路径
默认15:48:52.222575-0500 RunningBoard[可执行文件:71467]死亡哨兵开火!
默认值15:48:52.222934-0500 ReportCrash解析流程Beertabs的尸体数据[pid 71467]
默认15:48:52.228765-0500 runningboardd使发起者145的断言307-145-25867(目标:可执行文件)无效
默认15:48:52.330990-0500 RunningBoard删除进程:[可执行文件:71467]
默认15:48:52.339950-0500 RunningBoard删除终止进程的断言:[可执行文件:71467]
默认15:48:54.130670-0500报告崩溃发送事件:com.apple.stability.crash{“appVersion”:“?”,“bundleID”:“exceptionType”:2,“process”:“Beertabs”,“responsibleApp”:“Beertabs”}
默认15:48:54.130903-0500 analyticsd接收到的事件:com.apple.stability.crash{“appVersion”:“?”,“bundleID”:“exceptionType”:2,“process”:“Beertabs”,“responsibleApp”:“Beertabs”}
默认值15:48:54.131016-0500分析汇总。Transform:StabilityCrashNumerator3 Dirty:6事件:com.apple.stability.crash{“appVersion”:“?”,“bundleID”:“exceptionType”:2,“process”:“Beertabs”,“responsibleApp”:“Beertabs”,“timestamp”:1600289334130405}
默认值15:48:54.131108-0500 analyticsd聚合。Transform:StabilityCrashNumerator3 with incidentied Dirty:6事件:com.apple.stability.crash{“appVersion”:“?”,“bundleID”:“,“exceptionType”:2,“process”:“Beertabs”,“responsibleApp”:“Beertabs”,“timestamp”:1600289334130405}
默认15:48:54.174021-0500报告为Beertabs[71467]版本保存的崩溃报告???(???)至比尔塔布斯2020-09-16-154854
默认15:48:54.205327-0500报告崩溃删除过多日志:Beertabs_2020-09-16-154854_Rivendell.crash

问题是因为Info.plist文件不正确。将以下内容添加到cmakelists可以修复此问题

set_target_properties(Foo PROPERTIES
        MACOSX_BUNDLE_BUNDLE_NAME "AppName"
        MACOSX_BUNDLE TRUE
        MACOSX_BUNDLE_ICON_FILE icon_name.icns
        MACOSX_BUNDLE_LONG_VERSION_STRING 0.8.0
        MACOSX_BUNDLE_SHORT_VERSION_STRING 0.8.0
        MACOSX_BUNDLE_GUI_IDENTIFIER com.mycompany.appname
        XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@loader_path/Libraries"
        XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME TRUE
        XCODE_ATTRIBUTE_EXECUTABLE_NAME "appname")