xcode Jenkins 不受支持的构建操作“归档”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23650206/
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:55:34  来源:igfitidea点击:

Jenkins unsupported build action 'archive'

iosxcodejenkinsipa

提问by breaklee

I'm using Jenkins to build .ipa but there are errors when codesigning. why archive command unsupported?

我正在使用 Jenkins 构建 .ipa,但在代码签名时出现错误。为什么不支持存档命令?

The error I'm getting is:

我得到的错误是:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation /Users/Shared/Jenkins/Home/workspace/ginav-mobile/build/Distribution-iphoneos/ginav-mobile.app

** BUILD SUCCEEDED **

=== BUILD TARGET ginav-mobile OF PROJECT ginav-mobile WITH CONFIGURATION Distribution ===

Check dependencies
unsupported build action 'archive'
Code sign error: No command to generate product wrapper at '/Users/Shared/Jenkins/Home/workspace/ginav-mobile/build/Distribution-iphoneos/ginav-mobile.app'.

** ARCHIVE FAILED **

回答by Tamara Bernad

I got the same error. I managed to solve it after reading this thread.
The Xcode plugin seems to be using "-target" on the archive command, which not sure why doesn't work (anymore?)

我得到了同样的错误。阅读此线程后,我设法解决了它。
Xcode 插件似乎在存档命令上使用了“-target”,这不知道为什么不起作用(不再?)

What worked for me was: Instead of letting the plugin do the archive, I added an additional build step "Execute shell"with this command:

对我有用的是:我没有让插件进行存档,而是"Execute shell"使用以下命令添加了一个额外的构建步骤:

 "xcodebuild -project "TestApp.xcodeproj" -scheme "TestApp" -configuration Debug archive"



更深入


In Jenkins:

在詹金斯:

In your project configuration under "Build" in step "Xcode" under "General build settings" uncheck "Generate Archive?"

在“常规构建设置”下的“Xcode”步骤中的“构建”下的项目配置中,取消选中“生成存档?”

uncheck-generate-archive

取消选中生成存档


On "Add build step" drop-down select "Execute Shell"
Write this command with your respective App name and the Configuration (Debug) you need.


在“添加构建步骤”下拉列表中选择“执行外壳”,
使用您各自的应用程序名称和您需要的配置(调试)编写此命令。

xcodebuild -project "TestApp.xcodeproj" -scheme "TestApp" -configuration Debug archive


archive-command


归档命令



Now in Xcode, make sure your the Scheme is set to Shared and the Scheme Data is commited and pushed as well. Done in "Manage Scheme"



现在在 Xcode 中,确保您的 Scheme 设置为 Shared,并且 Scheme Data 也已提交和推送。在“管理方案”中完成

enter image description here

在此处输入图片说明


Otherwise Jenkins won't find your Scheme and will show an error similar to:


否则 Jenkins 将找不到您的 Scheme 并显示类似于以下内容的错误:

The project 'TestApp' does not contain a scheme named 'TestApp2'

This should make your app archive, hopefully it helps! This should create your archive.

这应该使您的应用程序存档,希望它有所帮助!这应该会创建您的存档。

PS: To make the Jenkins with Xcode setup I used this nice guide

PS:为了使用 Xcode 设置 Jenkins,我使用了这个不错的指南