lipo -create \[name1.a 所在路径\] \[name2.a 所在路径\] -output \[newname.a\]
合并.a
lipo -create /Users/Bing/Library/Developer/Xcode/DerivedData/TDSW-djaejeozrxozxogphpxlsptcvukz/Build/Products/Release-iphoneos/libTDSSDK.a /Users/Bing/Library/Developer/Xcode/DerivedData/TDSW-djaejeozrxozxogphpxlsptcvukz/Build/Products/Release-iphonesimulator/libTDSSDK.a -output /Users/Bing/Desktop/libTDSSDK.a
合并FrameWork
与.a类型, 不过注意后面需要加上framework目标文件名.
合成后再拷贝目标文件到原framework替换掉
lipo -create /Users/Bing/Library/Developer/Xcode/DerivedData/TDSSDK-frwnlksyppvghuedyawgdwhhapvo/Build/Products/Release-iphoneos/TDSSDK.framework/TDSSDK /Users/Bing/Library/Developer/Xcode/DerivedData/TDSSDK-frwnlksyppvghuedyawgdwhhapvo/Build/Products/Release-iphonesimulator/TDSSDK.framework/TDSSDK -output TDSSDK
上述生成framework在xcode 13上还报错, 示意framework既包含模拟器又包含真机, 无法在新版本xcode上运行,解决方案
1.加载framework的项目配置Build Setting > Build Options > Validate WorkSpace 设为YES
2.生成xcframework
sudo xcode-select --switch /Applications/Xcode.app
xcodebuild -create-xcframework -framework /Users/Bing/Library/Developer/Xcode/DerivedData/TDSSDK-frwnlksyppvghuedyawgdwhhapvo/Build/Products/Release-iphoneos/TDSSDK.framework -framework /Users/Bing/Library/Developer/Xcode/DerivedData/TDSSDK-frwnlksyppvghuedyawgdwhhapvo/Build/Products/Release-iphonesimulator/TDSSDK.framework -output TDSSDK.xcframework