Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 931
sliver Avatar asked Apr 07 '11 14:04

sliver


2 Answers

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.

like image 149
Joshua Nozzi Avatar answered Nov 15 '22 18:11

Joshua Nozzi


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

like image 24
Captnwalker1 Avatar answered Nov 15 '22 19:11

Captnwalker1