ios将模拟器与真机.a文件合并

1,command+b  build一下工程
2,Debug-iphoneos和Debug-iphonesimulator文件下都会出现一个.a文件
3,将Debug-iphonesimulator中重命名xxx_i386.a
4,将两个文件都拷贝到一个目录下,打开终端
5,
xxxiMac:111 Ken$ lipo -info libupnpx_i386.a
input file libupnpx_i386.a is not a fat file
Non-fat file: libupnpx_i386.a is architecture: i386
KenzhaotekiiMac:111 Ken$ lipo -create libupnpx.a libupnpx_i386.a libupnp_universal.a

6,
xxxiMac:111 Ken$ lipo -info libupnpx.a
Architectures in the fat file: libupnpx.a are: armv7 (cputype (12) cpusubtype (11))

7,(5,6)分别查看一个支持i386一个armv7,准备合并
xxxiMac:111 Ken$ lipo -create libupnpx.a libupnpx_i386.a libupnp_universal.a
lipo: no output file specified
lipo: Usage: lipo [input_file] ... [-arch <arch_type> input_file] ... [-info] [-detailed_info] [-output output_file] [-create] [-arch_blank <arch_type>] [-thin <arch_type>] [-remove <arch_type>] ... [-extract <arch_type>] ... [-extract_family <arch_type>] ... [-verify_arch <arch_type> ...] [-replace <arch_type> <file_name>] ...

8,查看生成文件
xxxiMac:111 Ken$ lipo -info libupnp_universal.a
Architectures in the fat file: libupnp_universal.a are: armv7 (cputype (12) cpusubtype (11)) i386

猜你喜欢

转载自zcw-java.iteye.com/blog/1893457