Build Settings
-> Build Library for Distribution
设置为 YES,否则在创建 xcframework 时会报错: No 'swiftinterface' files found within xx.swiftmodule
- 真机
xcodebuild archive -scheme Hei -configuration Release -destination 'generic/platform=iOS' -archivePath './build/Hei.framework-iphoneos.xcarchive' SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
- 模拟器
xcodebuild archive -scheme Hei -configuration Release -destination 'generic/platform=iOS Simulator' -archivePath './build/Hei.framework-iphonesimulator.xcarchive' SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild -create-xcframework -framework './build/Hei.framework-iphoneos.xcarchive/Products/Library/Frameworks/Hei.framework' -framework './build/Hei.framework-iphonesimulator.xcarchive/Products/Library/Frameworks/Hei.framework' -output './build/Hei.xcframework'