通过终端构建 xcode,使用“构建分析器”设置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17444252/
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-15 03:33:57  来源:igfitidea点击:

Build in xcode via terminal, using the "build for profiler" settings

xcodexcodebuild

提问by Nikolay Spassov

Is there a way to specify to xcodebuild, to build a specific scheme/configuration?

有没有办法指定 xcodebuild 来构建特定的方案/配置?

I have a project with multiple related projects; and when I want to build all, I just run it with "build for profiler", and it takes care to grab the right code, the right related projects in the solution and give me the resulting products compiled, and ready to be tested.

我有一个包含多个相关项目的项目;当我想构建所有内容时,我只需使用“构建分析器”来运行它,它会注意获取正确的代码、解决方案中正确的相关项目,并为我提供编译的结果产品,并准备好进行测试。

I am trying to automate the process, so I can run it via console; altho I've found no documentation that specify how to build for specific settings that you have in Xcode UI, but using the console version (xcodebuild).

我正在尝试自动化该过程,因此我可以通过控制台运行它;尽管如此,我没有找到任何文档指定如何为 Xcode UI 中的特定设置进行构建,而是使用控制台版本 (xcodebuild)。

I can build each project separately, and put all together by hand, but it is laborious and error prone; I would rather go for what Xcode does, but without using the UI at all.

我可以单独构建每个项目,然后全部手工组装,但既费力又容易出错;我宁愿选择 Xcode 所做的事情,但根本不使用 UI。

Not even sure if it is possible; any pointer is more than welcome. Thanks!

甚至不确定是否可能;任何指针都非常受欢迎。谢谢!

回答by Nikolay Spassov

Here is an example:

下面是一个例子:

$ xcodebuild -project MyProject.xcodeproj -alltargets -configuration Release

You can get the full documentation in the terminal with this command:

您可以使用以下命令在终端中获取完整文档:

$ man xcodebuild

There is also an article here: http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/

这里还有一篇文章:http: //blog.octo.com/en/automating-over-the-air-deployment-for-iphone/

回答by kuzdu

If you want to build a .xcworkspaceuse

如果你想建立一个.xcworkspace用途

xcodebuild -workspace your_project.xcworkspace -scheme your_sheme

xcodebuild -workspace your_project.xcworkspace -scheme your_sheme

Hereis a description where you find your scheme.

是您在其中找到您的计划的说明。

Tldr: left click on your project (red arrow) -> manage scheme -> use the selected one

Tldr:左键单击您的项目(红色箭头)-> 管理方案-> 使用选定的方案

enter image description here

在此处输入图片说明