目前ios的指令集有以下几种:

  • armv6

    • iPhone
    • iPhone2
    • iPhone3G
    • 第一代和第二代iPod Touch
  • armv7
    • iPhone4
    • iPhone4S
  • armv7s
    • iPhone5
    • iPhone5C
  • arm64
    • iPhone5S

机器对指令集的支持是向下兼容的,因此armv7的指令集是可以运行在iphone5S的,只是效率没那么高而已~

================================================

Architecture : 指你想支持的指令集。

Valid architectures : 指即将编译的指令集。

Build Active Architecture Only : 只是否只编译当前适用的指令集。

================================================

现在是2014年初,其实4和4S的用户还是蛮多的,而iphone3之类的机器几乎没有了,所以我们的指令集最低必须基于armv7.

因此,Architecture的值选择:armv7 armv7s arm64

PS:选arm64时需要最低支持5.1.1:

1,如果想自己的app在各个机器都能够最高效率的运行,则需要将Build Active Architecture Only改为NO,Valid architectures选择对应的指令集:armv7 armv7s arm64。这个会为各个指令集编译对应的代码,因此最后的 ipa体积基本翻了3倍,Release版本必须NO。

2,如果想让app体积保持最小,则现阶段应该选择Valid architectures为armv7,这样Build Active Architecture Only选YES或NO就无所谓了

参考文章:http://blog.csdn.net/oskytonight/article/details/22319853

Xcode中关于生成二进制包指令集相关的设置项有以下三个:

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 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.

该编译项指定可能支持的指令集,该列表和Architectures列表的交集,将是Xcode最终生成二进制包所支持的指令集

比如,你的Valid Architectures设置的支持arm指令集版本有:armv7/armv7s/arm64,对应的Architectures设置的支持arm指令集版本有:armv7s,这时Xcode只会生成一个armv7s指令集的二进制包。

Build Active Architecture Only

官方文档说明:

 
Boolean value. Specifies whether the product includes only object code for the native architecture.

该编译项用于设置是否只编译当前使用的设备对应的arm指令集。

当该选项设置成YES时,你连上一个armv7指令集的设备,就算你的Valid ArchitecturesArchitectures都设置成armv7/armv7s/arm64,还是依然只会生成一个armv7指令集的二进制包。

当然该选项起作用的前提是你的Xcode必须成功连接了调试设备。如果你没有任何活跃设备,即Xcode没有成功连接调试设备,就算该设置项设置成YES依然还会编译Valid ArchitecturesArchitectures指定的二进制包。

通常情况下,该编译选项在Debug模式都设成YES,Release模式都设成NO。

说明

  • 指令集都是可以向下兼容的

比如,你的设备是armv7s指令集,那么它也可以兼容运行比armv7s版本低的指令集:armv7、armv6

  • xcode对armv6指令集的支持

Xcode4.5起不再支持armv6,Xcode4.5的release notes中明确指出:

 
ChangesGeneral: iOSThis version of Xcode does not generate armv6 binaries. 12282156The minimum deployment target is iOS 4.3. 12282166

如何选择支持的指令集

如果你的软件对安装包大小非常敏感,你可以减少安装包中的指令集数据包,而且这能达到立竿见影的效果。

我们的项目之前支持的指令集是armv7/armv7s,后来改成只支持armv7后,比原来小了10MB左右。目前AppStore上的一些知名应用,比如百度地图腾讯地图通过反汇编工具查看后,也都只支持armv7指令集。

根据向下兼容原则,armv7指令集的应用是可以正常在支持armv7s/arm64指令集的机器上运行的。

不过对于armv7s/arm64指令集设备来说,使用运行armv7应用是会有一定的性能损失,不过这种损失有多大缺乏权威统计数据,个人认为是不会影响用户体验的。

iOS Architecture的更多相关文章

  1. iOS Architecture和Valid architectures

    目前ios的指令集有以下几种: 1,armv6,支持的机器iPhone,iPhone2,iPhone3G及对应的iTouch 2,armv7,支持的机器iPhone4,iPhone4S 3,armv7 ...

  2. iOS Architecture Patterns

    By Bohdan Orlov on 21 Mar 2016 - 0 Comments iOS FYI: Slides from my presentation at NSLondon are ava ...

  3. [Draft]iOS.Architecture.16.Truth-information-flow-and-clear-responsibilities-immutability

    Concept: Truth, Information Flow, Clear Responsibilities and Immutability 1. Truth 1.1 Single Source ...

  4. iOS之在写一个iOS应用之前必须做的7件事(附相关资源)

    本文由CocoaChina--不再犹豫(tao200610704@126.com)翻译 作者:@NIkant Vohra 原文:7 Things you must absolutely do befo ...

  5. iOS 架构模式--解密 MVC,MVP,MVVM以及VIPER架构

    本文由CocoaChina译者lynulzy(社区ID)翻译 作者:Bohdan Orlov 原文:iOS Architecture Patterns 在 iOS 中使用 MVC 架构感觉很奇怪? 迁 ...

  6. fir.im Weekly - iOS/Android 应用程序架构解析

    假如问你一个iOS or Android app的架构,你会从哪些方面来说呢? 本期 fir.im Weekly 收集了关于  iOS/Android 开发资源,也加入了一些关于 Web 前端方面的分 ...

  7. iOS Technology Overview_Introduction

    关于iOS技术 iOS是运行在iPad,iPhone和iPod touch设备上的操作系统.这个操作系统管理着这些设备的硬件并且提供了实现原生APP所需的技术.这个操作系统也附带许多系统APP,例如P ...

  8. iOS应用架构现状分析

    iOS从2007年诞生至今已有近10年的历史,10年的时间对iOS技术圈来说足够产生相当可观的沉淀,尤其这几年的技术分享氛围无论国内国外都显得异常活跃.本文就iOS架构这一主题,结合开发圈里讨论较多的 ...

  9. iOS项目的目录结构和开发流程

    转自无网不剩的博客 网上相关的资源不多,开源的且质量还不错的iOS项目也是少之又少,最近正好跟同事合作了一个iOS项目,来说说自己的一些想法.   目录结构 AppDelegate Models Ma ...

随机推荐

  1. Kinect帮助文档翻译之二 手势

    使用或创建手势 有两种方法可以将手势识别添加到你的unity项目中.第一种:找到KinectManager组件,在例子中它被附在MainCamera上.在组件中有两个列表的属性“Player1 Ges ...

  2. 《编写高质量代码:改善Java程序的151个建议》笔记

    To fight the unthinkable,you have to be willing to do the unthinkable.   不要在循环中使用try catch,应该放在循环的外面 ...

  3. C++ 11 新特性

    C++11新特性:          1.auto          2.nullptr          3.for          4.lambda表达式          5.override ...

  4. opencv中的Bayes分类器应用实例

    转载:http://blog.csdn.net/yang_xian521/article/details/6967515 PS:很多时候,我们并不需要特别精通某个理论,而且有的时候即便你非常精通,但是 ...

  5. navigationController.navigationBar.titleTextAttributes

    navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor ...

  6. 使用开关、分段控件和web视图

    #import "XViewController.h" @interface XViewController () @end @implementation XViewContro ...

  7. UICollectionViewLayout

    http://blog.csdn.net/majiakun1/article/details/17204921

  8. How Big Is A Petabyte, Exabyte, Zettabyte, Or A Yottabyte?

    一个关于Byte递增的描述,蛮有趣的! Bytes -> Kilobyte -> Megabyte -> Gigabyte -> Terabyte -> Petabyte ...

  9. hadoop命令行命令

    1. bin/hadoop fs -ls / 查看hdfs根目录下的文件 2. bin/hadoop fs -ls /user 查看user下文件 /就是根目录的意思.

  10. (转) C++ static、const和static const 以及它们的初始化

    const定义的常量在超出其作用域之后其空间会被释放,而static定义的静态常量在函数执行后不会释放其存储空间. static表示的是静态的.类的静态成员函数.静态成员变量是和类相关的,而不是和类的 ...