简体   繁体   English

Jenkins不支持构建操作'存档'

[英]Jenkins unsupported build action 'archive'

I'm using Jenkins to build .ipa but there are errors when codesigning. 我正在使用Jenkins来构建.ipa但是在编码时会出现错误。 why archive command unsupported? 为什么archive命令不受支持?

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 **

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插件似乎在archive命令中使用“-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"

More in depth 更深入

In Jenkins: 在詹金斯:

In your project configuration under "Build" in step "Xcode" under "General build settings" uncheck "Generate Archive?" 在“常规构建设置”下的“Xcode”步骤中的“构建”下的项目配置中,取消选中“生成存档?”

取消选中-产生归档


On "Add build step" drop-down select "Execute Shell" 在“添加构建步骤”下拉列表中选择“执行Shell”
Write this command with your respective App name and the Configuration (Debug) you need. 使用您需要的相应应用程序名称和配置(调试)编写此命令。

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


归档命令



Now in Xcode, make sure your the Scheme is set to Shared and the Scheme Data is commited and pushed as well. 现在在Xcode中,确保您的Scheme设置为Shared,并且还提交并推送Scheme Data。 Done in "Manage Scheme" 完成“管理计划”

在此输入图像描述


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' 项目'TestApp'不包含名为'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:为了让Jenkins使用Xcode设置,我使用了这个很好的指南

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM