开发者

Xcode - Building for Multiple Targets Simultaneously

I have one Xcode project with multiple targets. During development, it is becomin开发者_如何学Pythong laborious to compile and install each separately.

Is there a way, through scripting or otherwise; that I can automate the build and install to device of multiple targets at once.

Many thanks in advance!


Have you tried using xcodebuild from the command line?

xcodebuild -project projName -alltargets

man xcodebuild will list all available options.


xcodebuild does also support multiple targets it just does not say it anywhere in the man page or documentation

xcodebuild -target targ1 -target targ2


Within a target, you can add other targets as dependencies. So pick one that's going to be your "master" target, or just create another target to act as a container for all your other targets, add your other targets as dependencies, and build that.


In Xcode, within Product > Scheme > Manage Schemes, you'll see a list of schemes that were automatically added, i.e. one scheme for each target in the project. Edit the active scheme, then from the Build phase of that scheme add the secondary target. Now when you clean or build this project using the active scheme, it will clean or build both targets.

Note: the active scheme is shown checked on the Product > Scheme menu.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜