user635064
user635064

Reputation: 6247

Two .a files (one for device other for simulator)

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!

Upvotes: 1

Views: 233

Answers (3)

Plumenator
Plumenator

Reputation: 1682

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

Upvotes: 0

DHamrick
DHamrick

Reputation: 8488

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

lipo -create binary1.a binary2.a -output fatbinary.a

Upvotes: 1

sergio
sergio

Reputation: 69047

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.

Upvotes: 4

Related Questions