Build fat static library (device + simulator) using Xcode and SDK 4+

前端 未结 10 1111
独厮守ぢ
独厮守ぢ 2020-11-22 02:21

It appears that we can - theoretically - build a single static library that includes both simulator and iPhone and iPad.

However, Apple has no documentation on this

10条回答
  •  醉话见心
    2020-11-22 03:19

    I have spent many hours trying to build a fat static library that will work on armv7, armv7s, and the simulator. Finally found a solution.

    The gist is to build the two libraries (one for the device and then one for the simulator) separately, rename them to distinguish from each other, and then lipo -create them into one library.

    lipo -create libPhone.a libSimulator.a -output libUniversal.a
    

    I tried it and it works!

提交回复
热议问题