FRAMEWORK_NAME="${PROJECT_NAME}"
#FRAMEWORK_NAME="YourFrameworkTargetName"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
DEVICE_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphoneos/${FRAMEWORK_NAME}.framework"
UNIVERSAL_LIBRARY_DIR="${BUILD_DIR}/${CONFIGURATION}-iphoneuniversal"
FRAMEWORK="${UNIVERSAL_LIBRARY_DIR}/${FRAMEWORK_NAME}.framework"
xcodebuild -project ${PROJECT_NAME}.xcodeproj -sdk iphonesimulator -arch i386 -arch x86_64-target ${FRAMEWORK_NAME} -configuration ${CONFIGURATION} clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphonesimulator | echo
xcodebuild -project ${PROJECT_NAME}.xcodeproj -sdk iphoneos -arch arm64 -arch armv7 -arch armv7s -target ${FRAMEWORK_NAME} -configuration ${CONFIGURATION} clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphoneos | echo
rm -rf"${UNIVERSAL_LIBRARY_DIR}"
mkdir"${UNIVERSAL_LIBRARY_DIR}"
mkdir"${FRAMEWORK}"
cp -r"${DEVICE_LIBRARY_PATH}/.""${FRAMEWORK}"
lipo"${SIMULATOR_LIBRARY_PATH}/${FRAMEWORK_NAME}""${DEVICE_LIBRARY_PATH}/${FRAMEWORK_NAME}"-create -output"${FRAMEWORK}/${FRAMEWORK_NAME}"| echo
cd"${FRAMEWORK}"
chmod644${FRAMEWORK_NAME}
open"${FRAMEWORK}"
command+B 编译,结果会弹出
网友评论