本文介绍了在命令行中归档多个IOS Xcode目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有多个目标的iOS Xcode项目.随着项目的进行和扩展,项目中的目标数量将继续增长.当我创建一个新版本时,必须经历每个目标并手动创建存档是一件很痛苦的事情.我研究了如何使用命令行来归档多个目标,但是没有一个答案能说明我要完成的工作.感谢您的帮助和指导.

I have an iOS Xcode project that has several targets. The number of targets in the project will continue to grow as the project progresses and expands. When I create a new version, it is a pain to have to go through each target and manually create the Archive. I looked into how to archive multiple targets using the command line, but none of the answers spoke to what I was trying to accomplish. Any help and guidance is appreciated.

我相信以下部分命令是解决方案的一部分:

I believe that the following partial command is part of the solution:

xcodebuild存档

xcodebuild archive

归档文件:从构建根目录(SYMROOT)归档方案.这需要指定一个工作区和方案.

推荐答案

我想您要手动为CI服务器构建它如果您想阅读xcode项目中的所有方案

I suppose you want to build it for CI server ManuallyIf you want to read all the schemes in a xcode project

xcodebuild -list | awk 'p && NF {print \$0";";} /Schemes:/ {p=1}' > schemeList.txt

这会将您的所有方案都放在一个文本文件中.然后,您必须手动读取文本文件以检索每个方案.

This will put all your schemes in a text file. Then you have to read the text file manually to retrieve each scheme.

您可以使用下面的命令行来生成归档文件

You can use the below command line to produce the archive

xcodebuild -scheme ${schemeName} -sdk iphoneos$sdkVersion  -configuration Release clean archive -archivePath ${archivePath}.xcarchive

然后使用下面的xcode命令生成ipa.

And then the below xcode command to produce the ipa.

xcodebuild -exportArchive -archivePath ${archivePath}.xcarchive -exportOptionsPlist exportOptions.plist  -exportPath ${exportPath}

这篇关于在命令行中归档多个IOS Xcode目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 05:48