Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS making a universal library - for i386 and arm7

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.

like image 746
geekyaleks Avatar asked Dec 02 '22 19:12

geekyaleks


1 Answers

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
like image 153
clarkcox3 Avatar answered Dec 15 '22 02:12

clarkcox3