xcode xcodebuild - codesign -vvvv 说“资源信封已过时”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26008449/
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
xcodebuild - codesign -vvvv says"resource envelope is obsolete"
提问by Grantism
I've just updated my xcode install to use xcode 6.0.1 in order to start compiling my app for ios8 devices. For some reason I am not able to ever sign the app file correctly that is generated using the following:
我刚刚更新了我的 xcode 安装以使用 xcode 6.0.1,以便开始为 ios8 设备编译我的应用程序。出于某种原因,我无法正确签署使用以下内容生成的应用程序文件:
xcodebuild -project GrantM/GrantM.xcodeproj -configuration Release
it compiles the code and appears to be fine, but running:
它编译代码并且看起来很好,但是正在运行:
/usr/bin/codesign --verify -vvvv GrantM/GrantM.app
give me:
给我吗:
Program /usr/bin/codesign returned 1 : [GrantM/GrantM.app: resource envelope is obsolete]
Codesign check fails : GrantM/GrantM.app: resource envelope is obsolete
checking that the code was signed at all using: /usr/bin/codesign -dv GrantM/GrantM.app
检查代码是否完全使用:/usr/bin/codesign -dv GrantM/GrantM.app
returns:
返回:
Executable=Documents/GrantM/GrantM/GrantM.app/GrantM
Identifier=com.grantapps.GrantM
Format=bundle with Mach-O universal (armv7 (16777228:0))
CodeDirectory v=20200 size=647 flags=0x0(none) hashes=23+5 location=embedded
Signature size=4336
Signed Time=24 Sep 2014 12:54:53 pm
Info.plist entries=34
TeamIdentifier=N3KKU46JLY
Sealed Resources version=2 rules=5 files=55
Internal requirements count=1 size=180
has anyone else run into similar issues on OSX 10.9.5 & xcode 6.0.1? Or am I just being a bit stupid and doing something obvious wrong?
有没有其他人在 OSX 10.9.5 和 xcode 6.0.1 上遇到过类似的问题?或者我只是有点愚蠢并且做了一些明显的错误?
additionally, I was able to find the debug version of the app generated in xcode and could sign that successfully, but it being a debug version it won't work for distrobution. I can't even manually sign the xcodebuild generated app file.
此外,我能够找到在 xcode 中生成的应用程序的调试版本并可以成功签名,但它是一个调试版本,它不适用于分发。我什至无法手动签署 xcodebuild 生成的应用程序文件。
thanks for any help or advice in advance.
感谢您提前提供任何帮助或建议。
回答by Omkar
If you are using Mac OSX 10.9.5 or later, then there is an issue with OS codesigning with V2 signature.
如果您使用的是 Mac OSX 10.9.5 或更高版本,则使用 V2 签名的 OS 代码设计存在问题。
So, use --no-strict
flag with codesign --verify
to get over this error.
因此,使用--no-strict
flag withcodesign --verify
来克服这个错误。
If you're using PackageApplication to create an .ipa file, then
如果您使用 PackageApplication 创建 .ipa 文件,则
Edit the PackageApplication perl script tool using vi PackageApplication
command and update codesign function occurrences to pass --no-strict
parameter.
使用vi PackageApplication
命令编辑 PackageApplication perl 脚本工具并更新 codesign 函数出现以传递--no-strict
参数。
Example:
例子:
my $result = runCmd("/usr/bin/codesign", "--verify", "--no-strict", "-vvvv", , $plugin );
my $result = runCmd("/usr/bin/codesign", "--verify", "--no-strict", "-vvvv", , $plugin );
I was facing same and got the following response from Apple Dev Team. The issue is resolved for me.
我面临着同样的问题,并得到了 Apple Dev Team 的以下回应。问题已为我解决。
The command line tool “codesign” has changed in 10.9.5 and 10.10, you need to pass “--no-strict” option to the command, (the problem has been reported and will be fixed). To workaround the problem, please save a copy and modify PackageApplication to pass “—no-strict” to codesign, you can locate PackageApplication by running the following: xcrun -sdk iphoneos -f PackageApplication
命令行工具“codesign”在10.9.5和10.10有变化,需要给命令传递“--no-strict”选项,(问题已经反馈,会修复)。要解决此问题,请保存副本并修改 PackageApplication 以将“--no-strict”传递给 codesign,您可以通过运行以下命令找到 PackageApplication:xcrun -sdk iphoneos -f PackageApplication
回答by Sharkus
I've got a Jenkins CI system setup to provide automated builds of our iOS app from our git repo. In addition I also upload / submit a built to Crashlytics for crash log monitoring.
我有一个 Jenkins CI 系统设置来从我们的 git repo 提供我们 iOS 应用程序的自动构建。此外,我还上传/提交了一个内置的 Crashlytics 用于崩溃日志监控。
Everything worked fine with Xcode 6.0 GM, but since installing Xcode 6.0.1 the upload to Crashlytics fails with the same error. I'm asking for their assistance about this.
使用 Xcode 6.0 GM 一切正常,但由于安装了 Xcode 6.0.1,上传到 Crashlytics 失败并出现相同的错误。我正在寻求他们的帮助。
Part of my build job does use xcodebuild to generate an archive of the app, and from that I also use PackageApplication to get an .ipa file, and PackageApplication does issue the codesign command and that does NOT fail. I am using a distribution build, rather than debug too.
我的部分构建工作确实使用 xcodebuild 生成应用程序的存档,从中我还使用 PackageApplication 来获取 .ipa 文件,PackageApplication 确实发出了 codesign 命令并且不会失败。我正在使用发行版构建,而不是调试。
Here is the command I use to clean / archive the app in my job:
这是我用来在我的工作中清理/存档应用程序的命令:
xcodebuild clean archive -scheme MyScheme -target MyTarget -sdk iphoneos -configuration AdHoc CODE_SIGN_IDENTITY="iPhone Distribution: MyCompany" PROVISIONING_PROFILE="UDID_Of_Provisioning_Profile"
Here is the command I use to package / get an .ipa file of the app from within the generated archive:
这是我用来从生成的存档中打包/获取应用程序的 .ipa 文件的命令:
xcrun -sdk iphoneos PackageApplication "Path/to/MyApp.app" -o "/Path/To/MyApp.ipa" --sign "iPhone Distribution: MyCompany" --embed "Path/To/UDID_Of_Provisioning_Profile.mobileprovision"
Try modifying those to suit your setup and see if you get the same error.
尝试修改它们以适合您的设置,看看您是否遇到相同的错误。
回答by Nix Wang
In my case, I verified everyframework and dylib I used to find out which is rejected, then resign this very framework or dylib and the whole app saved my ass.
就我而言,我验证了我曾经使用过的每个框架和 dylib,找出哪些被拒绝,然后放弃这个框架或 dylib,整个应用程序救了我的屁股。
回答by Febin
Follow these steps to avoid this error.
请按照以下步骤避免此错误。
- Remove CFBundleResourceSpecification = ResourceRules.plist from Info.plist
- Avoid --resource-rules in the codesign line and do the code signing.
- Verify App: codesign --verify -vvvv Payload/*.app
- 从 Info.plist 中删除 CFBundleResourceSpecification = ResourceRules.plist
- 避免在 codesign 行中使用 --resource-rules 并进行代码签名。
- 验证应用程序:codesign --verify -vvvv Payload/*.app
回答by Vid
In OS 10.10, I have to remove --resource-rules
in the codesign
line
在OS 10.10,我不得不删除--resource-rules
的codesign
行
my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve
metadata=identifier,entitlements","--sign", $opt{sign});