xcode iPhone/iPad 主动式架构?它是什么?为什么会在那里?谁需要它?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2678084/
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
iPhone/iPad Active Architecture? What is it? Why is it there? Who needs it?
提问by ACBurk
What is this selection for? I have the Architectures set to Optimized (armv6 armv7)
so a fat binary should be getting build with both, right?
这个选择有什么用?我已经设置了架构,Optimized (armv6 armv7)
所以应该同时构建一个胖二进制文件,对吧?
So why does this need to set this in the menu? What does it do?
那么为什么这需要在菜单中设置呢?它有什么作用?
采纳答案by kharrison
Well mostly you do not need it, but even if you are building fat binaries you may not always be building both versions.
大多数情况下您不需要它,但即使您正在构建胖二进制文件,您也可能并不总是构建两个版本。
If you check the Build settings for the target there is an option in the Architectures section named "Build Active Architecture Only". I think by default this is selected when you are building for debug. The idea being that if you have armv6 device plugged in Xcode is smart enough to detect that and only build that version saving you some time.
如果您检查目标的构建设置,则架构部分中有一个名为“仅构建活动架构”的选项。我认为默认情况下,在构建调试时会选择此选项。这个想法是,如果你在 Xcode 中插入了 armv6 设备,那么它就足够聪明,可以检测到它,并且只构建那个版本可以为你节省一些时间。
Of course when you are building for distribution the option will not be checked to ensure you build for both architectures (not just the active one).
当然,当您为分发而构建时,不会选中该选项以确保您为两种体系结构(而不仅仅是活动的体系结构)构建。
So I guess the short answer is that you do need to mess with it as Xcode will set it for you based on which device you have plugged in.
所以我想简短的回答是你确实需要弄乱它,因为 Xcode 会根据你插入的设备为你设置它。
回答by Farcaller
armv6 is compatible with all iPhone/iPod touch/iPad devices.
armv6 与所有 iPhone/iPod touch/iPad 设备兼容。
armv7 is for newer devices which support OpenGL ES 2.0, including iPhone 3GS, recent iPod touch and iPad devices.
armv7 适用于支持 OpenGL ES 2.0 的较新设备,包括 iPhone 3GS、最新的 iPod touch 和 iPad 设备。
回答by abdus.me
Xcode detects which devices you have connected and will set the active architecture accordingly. So if you plug a 2nd generation iPod Touch into your computer Xcode should set the active architecture to armv6.
Xcode 会检测您连接了哪些设备,并相应地设置活动架构。因此,如果您将第二代 iPod Touch 插入您的计算机,Xcode 应将活动架构设置为 armv6。
When you create a Distribution configuration for publishing to the App Store you should make sure this option is not set so that you build the fat universal binary
创建分发配置以发布到 App Store 时,应确保未设置此选项,以便构建胖通用二进制文件