Cra*_*tis 75 macos xcode code-signing dropbox mac-app-store
我有一个OS X应用程序,它通过Mac App Store分发,最近更新到Xcode 4.6.3.
当我现在运行常规构建时,我会收到:
Command /usr/bin/codesign failed with exit code 1:
/Users/Craig/Library/Developer/Xcode/DerivedData/Mac-dxcgahgplwpbjedqnembegifbowj/Build/Products/Debug/MyApp.app: code object is not signed at all
In subcomponent: /Users/Craig/Library/Developer/Xcode/DerivedData/Mac-dxcgahgplwpbjedqnembegifbowj/Build/Products/Debug/MyApp.app/Contents/Frameworks/DropboxOSX.framework
Command /usr/bin/codesign failed with exit code 1
Run Code Online (Sandbox Code Playgroud)
我似乎无法辨别我的项目中的任何其他更改,因此我无法判断它是否与4.6.3更新或其他相关的问题.
我尝试重新启动Xcode,运行干净的构建,并清理构建文件夹.
Cra*_*tis 140
我想我可能已经想到了这个.我一直在OS X Mavericks上运行Xcode 4.6.3,其印象是任何特定于构建的工具都捆绑在Xcode应用程序中.
但是,似乎codesign
是在/usr/bin
.无论是由一个Xcode安装程序放在那里还是附带一个vanilla系统安装,我都不确定.但是通过阅读man
页面codesign
,我发现了这个漂亮的选项:
--deep When signing a bundle, specifies that nested code content such as helpers, frameworks, and plug-ins, should be recursively signed
in turn. Beware that all signing options you specify will apply, in turn, to such nested content.
When verifying a bundle, specifies that any nested code content will be recursively verified as to its full content. By default,
verification of nested content is limited to a shallow investigation that may not detect changes to the nested code.
When displaying a signature, specifies that a list of directly nested code should be written to the display output. This lists only
code directly nested within the subject; anything nested indirectly will require recursive application of the codesign command.
Run Code Online (Sandbox Code Playgroud)
然后我在两周前(〜2013年6月)发现了这篇文章(https://alpha.app.net/isaiah/post/6774960),其中提到了(虽然是第二手):
@isaiah我问过实验室里的一个人.他说,在签署应用程序包整体代码之前,codesign现在要求单独签署嵌入式框架.
手动重新运行codesign
Xcode正常运行的命令,同时将--deep
标志添加到末尾,正确签署应用程序.
我还不确定这个手动签名到底有什么影响,或者我是否可以调整Xcode构建以--deep
自动添加标志,但这似乎是潜在的问题.(codesign
不再自动深入签署您的应用包.)
rou*_*ter 67
正如其他答案所强调的那样,代码签名的工作方式也发生了变化.如果您安装了任何Xcode 5 DP,那么即使您使用的是Xcode 4.6.X,也会使用新工具.
在这个阶段你需要做的就是(在Xcode 4.6.X中)采用上面建议的--deep标志并将其添加到你的代码签名标志(Target,Build Settings)中,见下图.