如何使用 xcodebuild 构建特定架构? [英] How can I build a specific architecture using xcodebuild?
问题描述
我有依赖于 32 位
指针的遗留代码,并希望使用 xCodeBuild
从 命令行
构建该代码.由于某种原因,这不起作用.这是我使用的命令:
I have legacy code that relies on pointers being 32-bit
and want to use xCodeBuild
to build that code from command line
. This doesn't work for some reason. Here's the command I use:
xcodebuild -configuration Debug -arch i386
-workspace MyProject.xcworkspace -scheme MyLib
这是我得到的输出
[BEROR]No architectures to compile for
(ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
显然它正在尝试构建 x86_64
代码并且失败了,因为我只在 xCode 项目设置中从 VALID_ARCHS
启用了 i386
.
Clearly it's trying to build x86_64
code and failing miserably since I only enabled i386
from VALID_ARCHS
in xCode project settings.
有没有办法让它明白我不想要一个 64 位
库?
Is there a way to make it understand I don't want a 64-bit
library?
推荐答案
如果你想要 xcodebuild
,你必须将 ONLY_ACTIVE_ARCH
设置为 NO
使用 ARCHS
参数.通过传递这些参数,您可以强制使用正确的架构.
You have to set the ONLY_ACTIVE_ARCH
to NO
if you want xcodebuild
to use the ARCHS
parameters. By passing these parameters, you can force the proper architecture.
xcodebuild ARCHS=i386 ONLY_ACTIVE_ARCH=NO -configuration Debug -workspace MyProject.xcworkspace -scheme MyLib
请参阅此参考资料 了解详情.
这篇关于如何使用 xcodebuild 构建特定架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!