签署OSX 10.9框架 [英] Sign a Framework for OSX 10.9

查看:89
本文介绍了签署OSX 10.9框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用macdeployqt后,我对我的应用程序进行了签名,以避免Gatekeeper问题.

After using macdeployqt I sign my application to avoid Gatekeeper problems.

我可以在捆绑包中的所有框架和所有组件上使用codesign,但是当我对捆绑包进行签名时,我得到一个错误:

I can use codesign on all the frameworks and everything inside the bundle but when I come to sign the bundle I get an error:

$ codesign --force --verify --verbose --sign "Developer ID Application: My ID" MyApplication.app
MyApplication.app: bundle format unrecognized, invalid, or unsuitable
In subcomponent: /Users/username/Dev/Apps/MyApplication/MyApplication.app/Contents/Frameworks/QtConcurrent.framework

如果我检查签名:

$codesign -vvv MyApplication.app/Contents/Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent 
MyApplication.app/Contents/Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent: valid on disk
MyApplication.app/Contents/Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent: satisfies its Designated Requirement

根据 http://furbo.org/2013/10 /17/code-signing-and-mavericks/看来我应该对框架包进行签名

According to http://furbo.org/2013/10/17/code-signing-and-mavericks/ it seems that I should sign the framework bundle something like this

$ codesign --force --verify --verbose --sign "Developer ID Application: My ID" MyApplication.app/Contents/Frameworks/QtConcurrent.framework/Versions/5

但这会导致

MyApplication.app/Contents/Frameworks/QtConcurrent.framework/Versions/5: bundle format unrecognized, invalid, or unsuitable

推荐答案

今天早上遇到了相同的错误.代码签名应用程序似乎在OSX 10.9上更加严格

Got the same error this morning. The codesign application seems to be stricter on OSX 10.9

问题是由于macdeployqt没有将Qt框架捆绑包的info.plist文件复制到应用捆绑包中引起的.

The problem is caused by macdeployqt not copying the Qt framework bundles' info.plist file into the app bundle.

您可以通过告诉脚本手动将文件复制到嵌入式框架的捆绑文件中来解决此问题.

You can work around this problem by telling your script to copy the files manually into the embedded framework's bundle file.

例如

$ cp ~/Qt5.2.0/5.2.0-beta1/clang_64/lib/QtCore.framework/Contents/Info.plist MyApplication.app/Contents/Frameworks/QtCore.framework/Resources/

在调用macdeployqt *之后,但在调用codesign之前,对您的应用程序使用的每个qt模块执行此操作. (*或mkdir目标目录)

Do this for each of the qt modules your app uses, AFTER calling macdeployqt*, but BEFORE calling codesign. (* or mkdir the destination directories)

此外,在框架的文件夹而不是版本子文件夹上调用codesign.

Also, call codesign on the framework's folders, not on the version subfolder.

$ codesign --force --verify --verbose --sign "Developer ID Application: My ID" MyApplication.app/Contents/Frameworks/QtConcurrent.framework

希望这会有所帮助.

这篇关于签署OSX 10.9框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆