IOS framework项目编译和生成

TARGET_NAME=${PROJECT_NAME}
OUTPUT_DIR="${SRCROOT}/../Framework/"

if [ -d "${OUTPUT_DIR}"]
then 
rm -rf "${OUTPUT_DIR}"/*
else
mkdir -p "${OUTPUT_DIR}"
fi

xcodebuild -target "${TARGET_NAME}" -configuration "Release" -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${TARGET_NAME}" -configuration "Release" -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build

cp -R "${BUILD_DIR}/Release-iphoneos/${TARGET_NAME}.framework" "${OUTPUT_DIR}"
lipo -create "${BUILD_DIR}/Release-iphoneos/${TARGET_NAME}.framework/${TARGET_NAME}" "${BUILD_DIR}/Release-iphonesimulator/${TARGET_NAME}.framework/${TARGET_NAME}" -output "${OUTPUT_DIR}/${TARGET_NAME}.framework/${TARGET_NAME}"

open "${OUTPUT_DIR}"

你可能感兴趣的:(IOS framework项目编译和生成)