How do I archive multiple targets with one action in xcode 4

戏子无情 提交于 2019-12-05 13:10:17

问题


I have a project with multiple targets that are all for different iOS Apps. For instance one traget for the lite version and another one for the pro version.

I want to build and archive all of my Apps at once. Currently I have a scheme for every target which I use to archive each app independently. But now I have to start the archiving, wait until it is done and then start the next one.

Is there a way to archive all apps with one single action in xcode 4 or using the command line?


回答1:


The Build action in a scheme dictates what targets are built for what actions. Leave the defaults (so they'll all be built for the Archive action). When that scheme is active, it'll build all the requested targets just prior to archiving when you select Product -> Archive.

You could create a new scheme called "All", edit it, then in its Build action, add all targets you want to archive. Then just select that scheme and ask it to archive.

Alternatively, add all targets to your existing scheme and uncheck unwanted actions for which it should build those extra targets, leaving only Archive.




回答2:


You can use xcodebuild from the commandline

e.x. xcodebuild -configuration Release -project MyProject -scheme MyProjectScheme clean build

Also you can use xcrun to build an ipa from the commandline as well, see: https://stackoverflow.com/a/4198166/618419



来源:https://stackoverflow.com/questions/5582980/how-do-i-archive-multiple-targets-with-one-action-in-xcode-4

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