开发者

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

开发者 https://www.devze.com 2023-03-10 20:22 出处:网络
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 tes

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 开发者_如何学JAVAon where I want to test it? Thanks.

Oh btw, I am using Xcode 4. Thanks!


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.


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

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消