Some third party iOS library providers provide separate static library archives for simulator (i386) and device (armv6 and or armv7).

That's a pain since you either change them manually or set the linking flags on different Xcode targets to use the appropriate library (whereas normally with libraries and frameworks you just drag it into your project and you're done).

Instead, you can build your own fat (multi-architecture) library from the provided archives and Xcode will link against the appropriate architecture segment. 

We achieve this using the lipo tool, eg: 

lipo -output lib_fat.a -create -arch armv6 lib_device.a -arch l386 lib_sim.a

If they provide two archives—one regular i386 archive (with no fat header) for the simulator and one fat archive for the device with armv6 and armv7 segments. Since the device archive headers now specify the archives already, we don't need to tell lipo anything other than the archive file name.:

lipo -create lib_device.a lib_sim.a -output lib_fat.a

 

转载于:https://www.cnblogs.com/simonshi2012/archive/2013/04/27/3046186.html

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐