ios --resource-rules 在 mac os x >= 10.10 中已被弃用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26459911/
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
--resource-rules has been deprecated in mac os x >= 10.10
提问by hiennv92
I tried to resign my ipa file with new provisioning profile on Mac Os 10.10 with iResign app but I got this warning: "Warning: --resource-rules has been deprecated in Mac OS X >= 10.10".
我尝试使用 iResign 应用程序在 Mac Os 10.10 上使用新的配置文件重新签名我的 ipa 文件,但我收到此警告:“警告:--resource-rules 已在 Mac OS X >= 10.10 中弃用”。
What should I do now?
我现在该怎么办?
采纳答案by Sergey Kopanev
I found workaround: if you run the iResign app from XCode — then you will resign app without problem (warning will appears in console instead of popup). But if you close XCode and run app alone — then popup will back to you!
我找到了解决方法:如果您从 XCode 运行 iResign 应用程序 - 那么您将毫无问题地退出应用程序(警告将出现在控制台而不是弹出窗口中)。但是,如果您关闭 XCode 并单独运行应用程序 - 那么弹出窗口将返回给您!
BTW: bug found :) The condition
顺便说一句:发现错误:) 条件
if (systemVersionFloat < 10.9f)
Is broken for Yosemite 10.10. Funny.
为优胜美地 10.10 损坏。有趣的。
Thanks,
谢谢,
回答by Danut Pralea
回答by Ricardo Sanchez-Saez
Since Xcode 7, the Code Signing Resource Rules Path
build settingmust be left empty or else this warning is produced.
从Xcode 7 开始,Code Signing Resource Rules Path
构建设置必须留空,否则会产生此警告。
Technical Note TN2206provides the details:
技术说明 TN2206提供了详细信息:
Resource Rules
Systems before OS X Mavericks v10.9 documented a signing feature (--resource-rules) to control which files in a bundle should be sealed by a code signature. This feature has been obsoleted for Mavericks. Code signatures made in Mavericks and later always seal all files in a bundle; there is no need to specify this explicitly any more. This also means that the Code Signing Resource Rules Path build setting in Xcode should no longer be used and should be left blank.
It is thus no longer possible to exclude parts of a bundle from the signature. Bundles should be treated as read-only once they have been signed.
资源规则
OS X Mavericks v10.9 之前的系统记录了签名功能 (--resource-rules) 以控制捆绑包中的哪些文件应由代码签名密封。对于 Mavericks,此功能已过时。在 Mavericks 和以后制作的代码签名总是将所有文件密封在一个包中;无需再明确指定这一点。这也意味着 Xcode 中的代码签名资源规则路径构建设置不应再使用,应留空。
因此,不再可能从签名中排除部分包。捆绑包在签名后应被视为只读。
回答by Rodrigo Pinto
After Xcode 7 previous solutions stopped working. A new one was pointed by Rishi Goel (in https://stackoverflow.com/a/32762413/2252465)
在 Xcode 7 之前的解决方案停止工作之后。Rishi Goel 指出了一个新的(在https://stackoverflow.com/a/32762413/2252465 中)
- Remove
CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist
Find the
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication
script and update it.
Find the lines including the following code in the scriptmy @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules", "--sign", $opt{sign}, "--resource-rules=$destApp/ResourceRules.plist");
change it to:
my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements", "--sign", $opt{sign});
- 消除
CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist
找到
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication
脚本并更新它。
在脚本中找到包含以下代码的行my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules", "--sign", $opt{sign}, "--resource-rules=$destApp/ResourceRules.plist");
将其更改为:
my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements", "--sign", $opt{sign});
回答by Chintan Prajapati
Try adding below arguments in xcodebuild command.
尝试在 xcodebuild 命令中添加以下参数。
-sdk iphoneos CODE_SIGN_RESOURCE_RULES_PATH='$(SDKROOT)/ResourceRules.plist'
回答by technerd
If you are resigning app using terminal then you can even omit resource-rules
while performing code sign, as there is no need to externally specify which resource to sign and which to not. Now it is mandatory to sign all the resources inside package.
如果您正在使用终端退出应用程序,那么您甚至可以resource-rules
在执行代码签名时省略,因为无需从外部指定要签名的资源和不签名的资源。现在必须对包内的所有资源进行签名。
To resign app using terminal you can follow below steps:
要使用终端退出应用程序,您可以按照以下步骤操作:
unzip MyApp.ipa
rm -rf Payload/MyApp.app/_CodeSignature/
cp ~/Desktop/MyAdHoc.mobileprovision Payload/MyApp.app/embedded.mobileprovision
codesign -f -s "iPhone Distribution: Code signing Certificate for Enterprise or Ad-hoc app" Payload/MyApp.app
zip -qr MyApp_Resigned.ipa Payload/
回答by Chad Pavliska
I just opened my existing iOS app in Xcode 7 GM (from Xcode 6.4) and saw this deprecation warning.
我刚刚在 Xcode 7 GM(来自 Xcode 6.4)中打开了我现有的 iOS 应用程序,并看到了这个弃用警告。
It's interesting that answers and comments are saying to update the 'Code Signing Resource Rules Path' and they also reference Mac apps.
有趣的是,答案和评论说要更新“代码签名资源规则路径”,而且它们还引用了 Mac 应用程序。
In my case, the project had this key and value already set by default (I never set it). The warning is about resource rules being deprecated too.
就我而言,该项目默认已设置了此键和值(我从未设置过)。警告是关于资源规则也被弃用。
For me, deleting the value of the 'Code Signing Resource Rules Path' removed the warning. I have not submitted a new build this way so I may have to come back and update this answer.
对我来说,删除“代码签名资源规则路径”的值消除了警告。我还没有以这种方式提交新版本,所以我可能不得不回来更新这个答案。
Just thought it was interesting that my answer is opposite what everyone else was seeing.
只是觉得有趣的是,我的答案与其他人所看到的相反。
回答by Sheamus
If you comment out the two --resource-rules parameters from the arguments list, where the iResign app calls the codesign task, then you don't have to change the project build settings for the app's project.
如果您从参数列表中注释掉两个 --resource-rules 参数(iResign 应用程序在其中调用 codesign 任务),则您不必更改应用程序项目的项目构建设置。
I don't like the idea of having to modify the build settings for every project I want to work with, just so that I can resign it.
我不喜欢为我想使用的每个项目修改构建设置的想法,这样我就可以辞职。
I rebuilt the resign tool, and copied it to my Applications directory, so that I don't have to open it in Xcode.
我重建了 resign 工具,并将其复制到我的 Applications 目录中,这样我就不必在 Xcode 中打开它。