Archive multiple IOS xcode target in command line

匆匆过客 提交于 2019-12-11 09:28:07

问题


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 archive

archive: Archive a scheme from the build root (SYMROOT). This requires specifying a workspace and scheme.


回答1:


I suppose you want to build it for CI server Manually If 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

And then the below xcode command to produce the ipa.

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


来源:https://stackoverflow.com/questions/30176007/archive-multiple-ios-xcode-target-in-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!