使用xcodebuild 命令行編譯:
xcodebuild -scheme "QNBAutomatic" -configuration Release -arch arm64 -arch armv7 -sdk "iphoneos"
xcodebuild -scheme "QNBAutomatic" -configuration Release -arch x86_64 -sdk "iphonesimulator"
分別編譯模擬器和真機(jī)版本, 當(dāng)然還有其他硬件架構(gòu):-arch i386 -arch armv7s , 這些可以不用考慮皆刺。
分別編譯完成后奶赔,使用 lipo -create 合并靜態(tài)庫
使用 lipo -info libQQReader.a 查看二進(jìn)制文件支持的硬件架構(gòu)
關(guān)于更詳細(xì)的 lipo 用法枝冀,參考另一篇文章:lipo命令
git log -- 文件/目錄 查看該文件或目錄的提交改動(dòng)
參考文章:
An Introduction to Creating and Distributing Embedded Frameworks in iOS
Creating and Distributing an iOS Binary Framework
注:
使用另外一種命令行編譯方式會(huì)失敽瘟摺:
xcodebuild -target "${FRAMEWORK_NAME}" -configuration Release -arch arm64 -arch armv7 -arch armv7s only_active_arch=no defines_module=yes -sdk "iphoneos"
原因未明,可能是build目錄分散導(dǎo)致的,使用 -scheme 參數(shù)則ok