xcode指令集设置

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

i386:mac

armv6:iPhone,iPhone2,iPhone3G,第一代和第二代iPod Touch

armv7:iPhone 3GS, iPhone 4, iPhone 4S, iPod 3G/4G/5G, iPad, iPad 2, iPad 3, iPad Mini

armv7s:iPhone5,iPhone5C, iPad 4

ARMv8/ARM64: iPhone 6(Plus), iPhone 5s, iPad Air(2), Retina iPad Mini(2,3)

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

************************************************************************

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

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

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

************************************************************************

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

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

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

Convert Your App to a 64-Bit Binary After Updating It for iOS 7

Xcode 5.0.1 can build your app with both 32-bit and 64-bit binaries included. This combined binary requires a minimum deployment target of iOS 5.1.1 or later. The 64-bit binary runs only on 64-bit devices running iOS 7.0.3 and later. If you have an existing
app, you should first update your app for iOS 7 and then port it to run on 64-bit processors. By updating it first for iOS 7, you can remove deprecated code paths and use modern practices. If you’re creating a new app, target iOS 7 and compile 32-bit and 64-bit
versions of your app.

The architecture for 64-bit apps on iOS is almost identical to the architecture for OS X apps, making it easy to create a common code base that runs in both operating systems. Converting a Cocoa Touch app to 64-bit follows a similar transition process as the
one for Cocoa apps on OS X. Pointers and some common C types change from 32 bits to 64 bits. Code that relies on the NSInteger and CGFloat types
needs to be carefully examined.

Start by building the app for the 64-bit runtime, fixing any warnings that occur as well as searching your code for specific 64-bit issues. For example:

  • Make sure all function calls have a proper prototype.
  • Avoid truncating 64-bit values by accidentally assigning them to a 32-bit data type.
  • Ensure that calculations are performed correctly in the 64-bit version of your app.
  • Create data structures whose layouts are identical in the 32-bit and 64-bit versions of your app (such as when you write a data file to iCloud).

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就无所谓了

对于64位的支持

苹果明年2月强制64位支持

对于支持64-bit,我们可以设置Architectures为 Standard architectures,在最新的Xcode 6上,它包括 armv7和arm64。

让App支持32-bit和64-bit基本步骤

1.确保Xcode版本号>=5.0.1

2.更新project settings, minimum deployment target >= 5.1.1

3.改变Architectures为 Standard architectures(include 64-bit)

4.运行测试代码,解决编译warnings and errors,对照本文档或者官方文档 64-Bit
Transition Guide for Cocoa Touch
对相应地方做出修改。(编译器不能告诉我们一切)

5.在真实的64-bit机器上测试。

6.使用Instruments查看内存使用问题。

64-bit主要的变化

64-bit运行时环境和32-bit运行时环境主要有以下两点的不同:

数据类型的改变

方法调用上的改变

数据类型的改变

时间: 2024-07-30 13:43:19

xcode指令集设置的相关文章

XCode中设置字体大小

XCode中设置字体大小 1)打开Preferences,快捷键是“Command + ,”(注意,是三个键,按住command键,然后再快速地按“+”和“,”两个键即可) 2)选择“Fonts & Colors”,选中所有的“Category”,然后双击“Font”一列,在弹出的对话框中选择适合自己的字体大小即可.

Xcode中设置类库ARC支持

Xcode中设置类库ARC支持 Xcode中导入第三方类库等文件:如果导入的文件使用ARC的机制和你的当前项目使用的ARC机制不一样,那么Xcode会给出警告或报错.解决: 1,点击项目导航文件-> Targets ->  Build Phases -> Compile Sources 2,这个时候,我们看到第二列的名称为:Compiler Flags 3,双击你所要修改ARC的文件: 未支持ARC的支持ARC输入: -fno-objc-arc 支持ARC机制的不支持ARC机制输入: -

Jenkins Xcode 证书设置错误 Code Sign error: No matching codesigning identity found: No codesigning identities

Jenkins 集成Xcode 项目的时候在证书上遇到了问题.实际上如果在本地的话.只要Xcode工程里选择了项目就不需要重新设置证书了.jenkins会自动找到这个证书,只要在build setting 里设置的是正常的.并且在xcode 里能正常编译. Check dependencies Code Sign error: No codesigning identities found: No codesigning identities (i.e. certificate and priv

在xcode中设置include和lib路径

最近刚刚开始玩xcode,对着教程学编程时很少要动到项目设置,但昨天晚上想使用freetype验证上篇博文的问题,就需要设置include和lib路径了. 首先我下了freetype的源码,并在本地编译安装: $ cd freetype-2.6 $ ./configuration $ make check $ make install 很顺利. 直接新建一个命令行的project,贴入代码 - 编译,就会得到如下编译错误: 找不到头文件,应该是没有把ft2build.h所在的路径添加到inclu

iOS - Xcode 常用设置

1.main 文件注释 1)main 文件注释修改路径 /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/Project Templates/Base/Base.xctemplate/TemplateInfo.plist 2)示例设置文件 下载地址,密码:yar2. 2.main 函数配置 1)main 文件中 main 函数默认配置修改路径 /Applications/Xcode.app/Contents/De

Xcode常用设置

1.设置主题和字体大小 2.设置显示代码行号

ios开发xcode中设置代码块

在开发中有很多重复的代码,很多开发者把常用的代码做成代码块提高开发效率. 在xcode里选中代码块的时候总是很不容易,点击选中的代码(文字),不要移动和松开鼠标左键,当竖线变成像拉长了的x(我也不知道怎么形容)之后就可以拖动了,其实不需要多少时间,基本上就是:不要直接点鼠标左键就滑动鼠标,而是要下再拖动就可以了. 以后再使用这个代码就可以直接从里面拖出来就可以了 还可以自定义代码块的名称,使用范围,快捷键等

(转)Xcode 中设置部分文件ARC支持

ARC是什么 ARC是iOS 5推出的新功能,全称叫 ARC(Automatic Reference Counting).简单地说,就是代码中自动加入了retain/release,原先需要手动添加的用来处理内存管理的引用计数的代码可以自动地由编 译器完成了.该机制在 iOS 5/ Mac OS X 10.7 开始导入,利用 Xcode4.2 可以使用该机制.简单地理解ARC,就是通过指定的语法,让编译器(LLVM 3.0)在编译代码时,自动生成实例的引用计数管理部分代码.有一点,ARC并不是G

Xcode常见设置

1.设置主题和字体大小 2.设置显示代码行号