1. 复制一个 Release 的配置 名字为 Flaten
2.在配置Flaten 增加 Run Script
if [ "${CONFIGURATION}" == "Flaten" ]; then buildPath="${BUILD_DIR}/../.." xcodebuild -scheme ${TARGET_NAME} -sdk iphoneos -target ${PRODUCT_NAME} -configuration Release -derivedDataPath ${buildPath}; xcodebuild -scheme ${TARGET_NAME} -sdk iphonesimulator -target ${PRODUCT_NAME} -configuration Release -derivedDataPath ${buildPath}; up="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" lipo -create -output "${up}" "${buildPath}/Build/Products/Release-iphoneos/${EXECUTABLE_PATH}" "${buildPath}/Build/Products/Release-iphonesimulator/${EXECUTABLE_PATH}" fi
3.选中 Flaten 配置,编译
4.Products 下的 lib, 就是通用的 lib, 包括 i386 x86_64 armv7 arm64
备注:可用于 framework, 已经测试; 应该可以用于 dylib,猜测
随意转载,转载注明出处:https://doorxp.com/?id=44