[英]Error Creating IPA File for Enterprise Distribution from jenkins CI Server
When i try to generate a iOS app ipa file from jenkins CI Server, i am getting the following error. 当我尝试从jenkins CI Server生成iOS应用程序ipa文件时,出现以下错误。 can you suggest me? 你能建议我吗?
Error Log 错误记录
Output directory: '/Users/Username/.jenkins/workspace/JobName/build/appname.ipa'
Temporary Directory: '/var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A' (will NOT be deleted on exit when verbose set)
+ /bin/cp -Rp /Users/Username/.jenkins/workspace/JobName/build/appname.app /var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/Payload
Program /bin/cp returned 0 : []
+ /usr/bin/codesign --verify -vvvv /Users/Username/.jenkins/workspace/JobName/build/appname.app
Program /usr/bin/codesign returned 0 : [/Users/Username/.jenkins/workspace/JobName/build/appname.app: valid on disk
/Users/Username/.jenkins/workspace/JobName/build/appname.app: satisfies its Designated Requirement
]
Done checking the original app
+ /usr/bin/codesign -d --entitlements /var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/entitlements_rawrb2JgSwk /var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/Payload/appname.app
Program /usr/bin/codesign returned 0 : [Executable=/private/var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/Payload/appname.app/appname
]
+ /usr/libexec/PlistBuddy -c Set :get-task-allow NO /var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/entitlements_plistsdXXqkO6
Program /usr/libexec/PlistBuddy returned 0 : []
+ /usr/bin/plutil -lint /var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/entitlements_plistsdXXqkO6
Program /usr/bin/plutil returned 0 : [/var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/entitlements_plistsdXXqkO6: OK
]
+ /usr/bin/codesign --force --preserve-metadata=identifier,entitlements,resource-rules --sign iPhone Distribution:Dist cert name --resource-rules=/var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/Payload/appname.app/ResourceRules.plist --entitlements /var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/entitlements_plistsdXXqkO6 /var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/Payload/appname.app
Program /usr/bin/codesign returned 1 : [Warning: usage of --preserve-metadata with option "resource-rules" (deprecated in Mac OS X >= 10.10)!
Warning: --resource-rules has been deprecated in Mac OS X >= 10.10!
/var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/Payload/appname.app/ResourceRules.plist: cannot read resources
]
error: /usr/bin/codesign --force --preserve-metadata=identifier,entitlements,resource-rules --sign iPhone Distribution:Dist cert name --resource-rules=/var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/Payload/appname.app/ResourceRules.plist --entitlements /var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/entitlements_plistsdXXqkO6 /var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/Payload/appname.app failed with error 1. Output: Warning: usage of --preserve-metadata with option "resource-rules" (deprecated in Mac OS X >= 10.10)!
Warning: --resource-rules has been deprecated in Mac OS X >= 10.10!
/var/folders/74/t1j47pm914jbphlv2htlhx4mwl864h/T/S8Iquejn1A/Payload/appname.app/ResourceRules.plist: cannot read resources
Failed to build /Users/Username/.jenkins/workspace/JobName/build/appname.ipa
Build step 'Xcode' marked build as failure
To fix this error, I had to edit the PackageApplication perl script provided by Apple. 要解决此错误,我必须编辑Apple提供的PackageApplication perl脚本。 The resource-rules parameter has been deprecated since Mavericks but is still used in the script... It's a bit hacky but the only way I found. 自Mavericks以来,resource-rules参数已被弃用,但仍在脚本中使用...有点hacky,但这是我找到的唯一方法。
So, first backup this script, then edit it : 因此,首先备份此脚本,然后对其进行编辑:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication
Replace 更换
my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules",
"--sign", $opt{sign},
“--resource-rules=$destApp/ResourceRules.plist");
With 用
my @codesign_args;
if (-e '$destApp/ResourceRules.plist') { # If ResourceRules.plist exists, include it in codesign arguments, for backwards compatability
@codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules",
"--sign", $opt{sign},
"--resource-rules=$destApp/ResourceRules.plist");
} else { # If ResourceRules.plist isn't found, don't include it in the codesign arguments
@codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements",
"--sign", $opt{sign});
}
Source : http://www.jayway.com/2015/05/21/fixing-your-ios-build-scripts/ 来源: http : //www.jayway.com/2015/05/21/fixing-your-ios-build-scripts/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.