ios - Xcode build设置中的 "Architectures"和 "Valid Architectures"有什么区别?

标签 ios xcode xcode4.5

它们的含义是什么,我可以将它们设置为不同的值吗?

最佳答案

架构是您想要构建的架构,有效的架构是您可以设想使用您的代码库构建的架构。

所以也许您只想为 armv7 构建二进制文件,但相同的源代码可以为 armv7 和 armv6 编译。所以 VALID_ARCHS = armv6 armv7 armv7s,但是您设置了 ARCHS = armv7s 因为这就是您实际上想要使用您的代码构建的所有内容。

或者,用苹果语:

ARCHS (Architectures)

Space-separated list of identifiers. Specifies the architectures (ABIs, processor models) to which the binary is targeted. When this build setting specifies more than one architecture, the generated binary may contain object code for each of the specified architectures.

和:

VALID_ARCHS (Valid Architectures)

Space-separated list of identifiers. Specifies the architectures for which the binary may be built. During the build, this list is intersected with the value of ARCHS build setting; the resulting list specifies the architectures the binary can run on. If the resulting architecture list is empty, the target generates no binary.

来源:Xcode Build Setting Reference

在实践中,您不用管 VALID_ARCHS 并且不必担心更改它,只需摆弄 ARCHS 即可设置您要构建的架构。通常,您将 Debug 版本设置为 NATIVE_ARCH,因为您只想为您将在其上测试/运行它的机器构建调试版本,而 Release 版本则适用于您的所有架构计划支持。

关于ios - Xcode build设置中的 "Architectures"和 "Valid Architectures"有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12701188/

相关文章:

ios - 在 Swift 中替换默认手势识别器的正确方法

ios6 - Xcode 4.5 iOS SDK 6.0 Beta 4 编译的应用程序在背景中出现细白线

ios - 如何提交与旧版本 iOS 不兼容的新版本应用程序?

iOS ARKit : Integrate AR feature in existing iOS Project

调试和分发之间的 iOS App build设置差异

ios - 自定义 AlertView - Xcode

ios - 如何在函数完成之前停止 viewWillAppear 完成

objective-c - xcode 等待应用程序启动时超时

objective-c - 在 iOS 中将日期转换为第二天的日期

ios - Swift:垂直滚动内水平滚动内垂直滚动