codesign --deep on Mavericks xcode 5.0 (5A1412)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20266954/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:21:50  来源:igfitidea点击:

codesign --deep on mavericks xcode 5.0 (5A1412)

xcodemacoscocoaosx-maverickscodesign

提问by Parag Bafna

I am using codesignwith —deepoption.

我使用codesign—deep选择。

enter image description here

在此处输入图片说明

/usr/bin/codesign --verbose --force --sign "Developer ID Application: myCompany” —deep myApp.app

on 10.8 its working fine

在 10.8 上它工作正常

$ codesign -vvv myApp.app
myApp.app: valid on disk
myApp.app: satisfies its Designated Requirement

But on 10.9 i am getting nested code is modified or invalid.

但是在 10.9 我得到nested code is modified or invalid.

$ codesign -vvv myApp.app
myApp.app: nested code is modified or invalid
file modified: myApp.app/Contents/MacOS/SecondUtility 

I have two executable in MacOS folder, one is from build phase(Destination: executables)

我在 MacOS 文件夹中有两个可执行文件,一个来自构建阶段(目标:可执行文件)

$codesign -vvv myApp.app/Contents/MacOS/SecondUtility
myApp.app/Contents/MacOS/SecondUtility: valid on disk
myApp.app/Contents/MacOS/SecondUtility: does not satisfy its designated Requirement

Run Scriptwith the code sign shell command is also not working for me.

使用代码签名 shell 命令运行脚本也不适用于我。

Can anyone please help me out?

任何人都可以帮我吗?

采纳答案by Parag Bafna

After creating build in Xcode 5, again code sign SecondUtility and myApp.app.

在 Xcode 5 中创建构建后,再次对 SecondUtility 和 myApp.app 进行代码签名。

sudo /usr/bin/codesign --verbose --force --sign "Developer ID Application: myCompany" myApp.app/Contents/MacOS/SecondUtility

sudo /usr/bin/codesign --verbose --force --sign "Developer ID Application: myCompany" myApp.app

Now its working fine.

现在它工作正常。

Run Script with the code sign shell command is not working for me.

使用代码签名 shell 命令运行脚本对我不起作用。

EDIT

编辑

Have a look at OS X Code Signing In Depth

深入了解OS X 代码签名

Beginning with OS X version 10.9.5, there will be changes in how OS X recognizes signed apps

从 OS X 版本 10.9.5 开始,OS X 识别签名应用程序的方式将发生变化

Structure your bundleaccording to the expectations for OS X version 10.9 or later:

根据对 OS X 10.9 或更高版本的期望构建您的包

  • Only include signed code in directories that should contain signed code.
  • Only include resources in directories that should contain
    resources.
  • Do not use the --resource-rules flag or ResourceRules.plist. They have been obsoleted and will be rejected.
  • 仅在应包含签名代码的目录中包含签名代码。
  • 仅在应包含
    资源的目录中包含资源。
  • 不要使用 --resource-rules 标志或 ResourceRules.plist。它们已过时,将被拒绝。