Since some people asked for exact steps on how to create the fat framework with lipo, here is how I did it:
# Create a template framework starting from the arm64 ios simulator one
mkdir -p build-iossim
cp -r build-iossim-arm64-release/target/MyFramework.framework build-iossim
# Merge the arm64 and x86_64 binaries with lipo
xcrun lipo -create -output build-iossim/MyFramework.framework/MyFramework build-iossim-x86_64-release/target/MyFramework.framework/MyFramework build-iossim-arm64-release/target/MyFramework.framework/MyFramework
# Codesign the fat binary
xcrun codesign --sign - build-iossim/MyFramework.framework/MyFramework
# Create the xcframework merging the ios_arm64 framework and the fat simulator framework
mkdir -p build-xcframework
xcodebuild -create-xcframework \
-framework build-ios-arm64-release/target/MyFramework.framework \
-framework build-iossim/MyFramework.framework \
-output "build-xcframework/MyFramework.xcframework"
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: