4

We are building a library for use in iOS development. We can generate either a i386 library for the simulator, or a arm7 library for the hardware device. As it is now, we need to have two different files (.a libraries) when distributing the library to our other developers. This is a little bit cumbersome for distribution purposes. I was wondering; is there a way to build the library in XCode so that a single .a library file has both i386 and arm7 in it, so that we can distribute just a single library file for both architectures i386 and arm7.

artless noise
  • 21,212
  • 6
  • 68
  • 105
geekyaleks
  • 1,281
  • 3
  • 18
  • 29
  • I deal with another SDK that has the same problem. The libraries are named the same, and we just ensure we have the right ones in place when we build. It's not much of an issue. – Marcus Adams Jun 24 '13 at 19:21

1 Answers1

18

You can use the lipo tool to stitch those two files into a single “universal” file:

lipo -create <i386_lib>.a <armv7_lib>.a -output lib.a
clarkcox3
  • 580
  • 4
  • 12
  • You can also double check the input libraries and that this was successful using `lipo -info lib.a` – Meekohi Dec 03 '15 at 16:01