Home > Software design >  Cannot lipo arm64 .a files of iOS device with iOS simulator on Apple Silicon
Cannot lipo arm64 .a files of iOS device with iOS simulator on Apple Silicon

Time:12-17

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?

CodePudding user response:

I think you should output a XCFramework.

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

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

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

  • Related