ios 静态库创建
2014-03-27 15:56
232 查看
新建工程
这里注意一下 需要编译两次 1.IOS Device 状态编译 2.iphone 模拟器编译
终端命令:
1。进入指定路径
~ xiegongquan$ cd /Users/xiegongquan/Library/Developer/Xcode/DerivedData/MyLib-cdtlqeaxjwlelteszvrmecwobgfd/Build/Products/
Products xiegongquan$ pwd
/Users/xiegongquan/Library/Developer/Xcode/DerivedData/MyLib-cdtlqeaxjwlelteszvrmecwobgfd/Build/Products
2.查看路径包含的内容
Products xiegongquan$ ls
Release-iphoneos
Release-iphonesimulator
3.查看文件信息 Release-iphoneos
Products xiegongquan$ lipo -info Release-iphoneos/libMyLib.a
Architectures
in the fat file: Release-iphoneos/libMyLib.a are:
armv7 (cputype (12) cpusubtype (11)) (cputype (16777228) cpusubtype (0))
3.查看文件信息 Release-iphonesimulator
Products xiegongquan$ lipo -info Release-iphonesimulator/libMyLib.a
Architectures
in the fat file: Release-iphonesimulator/libMyLib.a are:
i386 x86_64
注意红色部分 ,在模拟器中使用的是 i386 x86_64 而在真机 中使用的是 armv7
;所以需要下面把这两个合并,这样就可以在模拟器和真机中都可以使用
4.合并libMyLib.a
Products xiegongquan$ lipo -create Release-iphoneos/libMyLib.a Release-iphonesimulator/libMyLib.a -output libMyLib.a
5.查看路径
xiegongzenmatoiMac:Products xiegongquan$ pwd
/Users/xiegongquan/Library/Developer/Xcode/DerivedData/MyLib-cdtlqeaxjwlelteszvrmecwobgfd/Build/Products
6.查看路径中的内容
xiegongzenmatoiMac:Products xiegongquan$ ls
Release-iphoneos
Release-iphonesimulator libMyLib.a
7.查看信息
xiegongzenmatoiMac:Products xiegongquan$ lipo -info libMyLib.a
Architectures
in the fat file: libMyLib.a are:
armv7 (cputype (12) cpusubtype (11)) (cputype (16777228) cpusubtype (0))
i386 x86_64
自此静态创建完成
下面是测试:注意 libMyLib.a 文件 确保没问题最好先查看下该库的信息
确保信息如下:(蓝色部分)
rchitectures in the fat file: libMyLib.a are:
armv7 (cputype (12) cpusubtype (11)) (cputype (16777228) cpusubtype (0))
i386 x86_64
这里注意一下 需要编译两次 1.IOS Device 状态编译 2.iphone 模拟器编译
终端命令:
1。进入指定路径
~ xiegongquan$ cd /Users/xiegongquan/Library/Developer/Xcode/DerivedData/MyLib-cdtlqeaxjwlelteszvrmecwobgfd/Build/Products/
Products xiegongquan$ pwd
/Users/xiegongquan/Library/Developer/Xcode/DerivedData/MyLib-cdtlqeaxjwlelteszvrmecwobgfd/Build/Products
2.查看路径包含的内容
Products xiegongquan$ ls
Release-iphoneos
Release-iphonesimulator
3.查看文件信息 Release-iphoneos
Products xiegongquan$ lipo -info Release-iphoneos/libMyLib.a
Architectures
in the fat file: Release-iphoneos/libMyLib.a are:
armv7 (cputype (12) cpusubtype (11)) (cputype (16777228) cpusubtype (0))
3.查看文件信息 Release-iphonesimulator
Products xiegongquan$ lipo -info Release-iphonesimulator/libMyLib.a
Architectures
in the fat file: Release-iphonesimulator/libMyLib.a are:
i386 x86_64
注意红色部分 ,在模拟器中使用的是 i386 x86_64 而在真机 中使用的是 armv7
;所以需要下面把这两个合并,这样就可以在模拟器和真机中都可以使用
4.合并libMyLib.a
Products xiegongquan$ lipo -create Release-iphoneos/libMyLib.a Release-iphonesimulator/libMyLib.a -output libMyLib.a
5.查看路径
xiegongzenmatoiMac:Products xiegongquan$ pwd
/Users/xiegongquan/Library/Developer/Xcode/DerivedData/MyLib-cdtlqeaxjwlelteszvrmecwobgfd/Build/Products
6.查看路径中的内容
xiegongzenmatoiMac:Products xiegongquan$ ls
Release-iphoneos
Release-iphonesimulator libMyLib.a
7.查看信息
xiegongzenmatoiMac:Products xiegongquan$ lipo -info libMyLib.a
Architectures
in the fat file: libMyLib.a are:
armv7 (cputype (12) cpusubtype (11)) (cputype (16777228) cpusubtype (0))
i386 x86_64
自此静态创建完成
下面是测试:注意 libMyLib.a 文件 确保没问题最好先查看下该库的信息
确保信息如下:(蓝色部分)
rchitectures in the fat file: libMyLib.a are:
armv7 (cputype (12) cpusubtype (11)) (cputype (16777228) cpusubtype (0))
i386 x86_64
相关文章推荐
- 【翻译】ios教程-创建静态库
- 【如何在Xcode4上创建并使用iOS的静态库】
- iOS:Xcode7下创建 .a静态库 和 .framework静态库
- 手动创建ios静态库
- 在iOS中创建静态库
- iOS - 静态库的创建与使用
- 在iOS中创建静态库
- iOS开发-Xcode5创建静态库详解(Cocoa Touch Static Library)
- iOS开发-Xcode5创建静态库详解(Cocoa Touch Static Library)
- ios 创建静态库
- iOS创建静态库
- iOS 创建静态库
- ios 创建静态库
- 在iOS中创建静态库
- iOS中静态库的制作——使用创建静态库项目的方式创建静态库
- iOS 创建Cocoa touch Static Library 静态库(二进制库)和bundle
- 在iOS中创建静态库
- IOS之创建一个静态库
- IOS在Xcode 4.x以上如何 创建 和 添加 静态库
- iOS (static library)静态库的创建与使用