0

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?

4

1 回答 1

1

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

于 2021-12-15T17:21:46.200 回答