1

I was given an SDK which I need to integrate into an iPhone app. I was given 2 .a files, one for simulator and one for the device. Right now, I have to constantly swap these files depending on the testing destination (device or simulator). Is there a way I can make it so Xcode automatically configures the right .a file depending on where I want to test it? Thanks.

Oh btw, I am using Xcode 4. Thanks!

user635064
  • 6,219
  • 12
  • 54
  • 100

3 Answers3

4

I would try and build a fat, i386/arm version of the library by using lipo.

You can use this command:

 lipo -create liblib-i386.a liblib-arm.a -output liblib-fat.a

The linker will be able to extract just the symbols it needs from it according to the platform.

sergio
  • 68,819
  • 11
  • 102
  • 123
1

You can use lipo to create a "fat binary" that contains both architectures.

lipo -create binary1.a binary2.a -output fatbinary.a
DHamrick
  • 8,338
  • 9
  • 45
  • 62
0

You can also create two targets and use the appropriate lib file.

Plumenator
  • 1,682
  • 3
  • 20
  • 49