What Xcode settings should I use to support both armv6 and armv7?

China☆狼群 提交于 2019-12-07 14:57:25

问题


I recently upgraded Xcode from 3.2 to 4.2. After the upgrade I was having trouble testing my app on an iPhone 3 device because my target's "Build Settings" "Architectures" item was set to armv7. Switching "Architectures" to armv6 fixed the problem.

But this got me thinking that I better make sure I use the correct setting for my App Store version so that my app works for people using an armv6 device.

So is it just a matter of switching my "Project"'s "Build Settings" "Architecture" item to armv6 as well or do I need to do something different?

What settings can I use so that an armv6 device always uses armv6 and also so that an armv7 device always uses armv7? During both testing and for apps that I release to the app store.


回答1:


To make Xcode generate a binary that works on armv6 and armv7 devices, you should set the following build settings:

  • Architectures : $(VALID_ARCHS)
  • Valid Architectures: armv6 armv7 (default value)
  • iOS Deployment target : iOS 4.2.1 or lower

You also have to remove armv7 from Required Device Capabilities in the info.plist file.




回答2:


Set the following build settings:

  • Valid Architectures: armv6 armv7
  • Architectures: Optimized (armv6 armv7)

This will generate different optimized binaries for both architectures.



来源:https://stackoverflow.com/questions/9447349/what-xcode-settings-should-i-use-to-support-both-armv6-and-armv7

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!