Smeegol
Smeegol

Reputation: 2098

Cannot lipo arm64 .a files of iOS device with iOS simulator on Apple Silicon

Shell commands as below,

$ lipo -info libyuv-device.a
Architectures in the fat file: device/libyuv.a are: armv7 arm64
$ lipo -info libyuv-simulator.a
Architectures in the fat file: simulator/libyuv.a are: arm64 x86_64
$ lipo -create libyuv-device.a libyuv-simulator.a -output libyuv.a
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: libyuv-device.a and libyuv-simulator.a have the same architectures (arm64) and can't be in the same fat output file

How to lipo multiple arm64 .a files of iOS device and iOS simulator (on Apple Silicon, e.g. M1) into one single .a file?

Upvotes: 3

Views: 1611

Answers (1)

Kireyin
Kireyin

Reputation: 162

I think you should output a XCFramework.

1 - Use lipo to combine architectures per platforms like you did.

2 - Then use xcodebuild -create-xcframework to combine the platforms.

xcodebuild -create-xcframework -library libyuv-device.a -library libyuv-simulator.a -output libyuv.xcframework

Upvotes: 4

Related Questions