XCode - 同时为多个目标构建

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6859911/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 21:35:38  来源:igfitidea点击:

XCode - Building for Multiple Targets Simultaneously

iphoneobjective-ciosxcode

提问by adam

I have one Xcode project with multiple targets. During development, it is becoming laborious to compile and install each separately.

我有一个带有多个目标的 Xcode 项目。在开发过程中,单独编译和安装它们变得很费力。

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!

提前谢谢了!

采纳答案by Daniel Dickison

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.

在一个目标中,您可以添加其他目标作为依赖项。因此,选择一个将成为“主”目标的目标,或者只是创建另一个目标作为所有其他目标的容器,将其他目标添加为依赖项,然后构建它。

回答by sergio

Have you tried using xcodebuildfrom the command line?

您是否尝试过xcodebuild从命令行使用?

xcodebuild -project projName -alltargets

man xcodebuildwill list all available options.

man xcodebuild将列出所有可用选项。

回答by Captnwalker1

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

xcodebuild也支持多个目标,只是没有在手册页或文档中的任何地方说明

xcodebuild -target targ1 -target targ2