iOS lipo 判断静态库是否支持64位
来源:互联网 发布:ubuntu touch 平板安装 编辑:程序博客网 时间:2024/05/20 22:27
整理下查到的资料
1 、iOS Xcode5.1 armv7 armv7s arm64 类型, 区分, 概念等
官方:
https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/Introduction/Introduction.html
https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/OptimizingMemoryPerformance/OptimizingMemoryPerformance.html#//apple_ref/doc/uid/TP40013501-CH4-SW1
目前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:
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就无所谓了
2 、xcode6,Architecture默认没有armv7s,
某论坛上的一个很靠谱的问答:
最近装了Xcode6,以便适配iOS8。可是打包出问题了,打好的包没有armv7s。
原因是Build Settings中的Architectures项中的$(ARCHS_STANDARD)不含armv7s,只有armv7和arm64,好吧,另外加上一个armv7s就好了
3、判断静态库是否支持64位
打开终端,cd到静态库的地方。输入命令
.framework文件
lipo -info ./****.framework/****
返回结果
Architectures in the fat file: ./****.framework/**** are: i386 armv7 armv7s
如此便可查看你工程中的静态库是否支持64位。
.a文件lipo -info libUPPayPlugin.a
结果Architectures in the fat file: libUPPayPlugin.a are: armv7 armv7s arm64 i386 x86_64
- iOS lipo 判断静态库是否支持64位
- 如何判断静态库是否支持64位。
- mac终端查看ios静态库是否支持64位
- ios 查看文件是否支持64位
- 判断IOS静态库(.a文件)是否支持模拟器和真机运行
- iOS静态库的编译和lipo命令的使用
- lipo命令合并和拆分IOS静态库
- iOS静态库的编译和lipo命令的使用
- [iOS 静态库打包] 如何让静态库支持64位
- mac 上如何查看.a 静态库文件是否支持64位,
- zbar 支持64位 静态库编译
- iOS如何查看静态库.a文件是否支持i386?
- ios 32/64位 lame静态库libmp3lame.a 编译,支持arm64 armv7s x86_64 i386 armv7
- 生成支持32位和64位静态库
- 64位移植:判断库dll是否为64位
- iOS开发之使用lipo命令制作模拟器与真机通用静态库
- iOS开发之使用lipo命令制作模拟器与真机通用静态库
- iOS开发之使用lipo命令制作模拟器与真机通用静态库
- ‘tools.jar’ seems to be not in Android Studio classpath解决方法
- 《剑指offer》连续子数组的最大和
- 黑马程序员——ios基础---练习:2
- 集合对象中是线程安全
- adapter刷新
- iOS lipo 判断静态库是否支持64位
- 常用类的练习
- 黑马程序员——ios基础---练习:3
- JSDoc3使用路径名
- 3.Longest Substring Without Repeating Characters
- 好记性不如好博客
- CentOS下yum安装 Nginx
- 黑马程序员——ios基础---练习:4
- 第98讲:使用SBT开发时动手解决rt.jar中CharSequence is broken等问题学习笔记