set -e
pod install
pod update
rm -fr build
mkdir -p build/Output
xcodebuild \
-workspace “xxxx(替换SDK的名字).xcworkspace” \
-scheme “xxxx(替换SDK的名字)” \
-derivedDataPath build \
-arch armv7 -arch armv7s -arch arm64 \
-sdk iphoneos \
ONLY_ACTIVE_ARCH=NO \
-configuration Release \
-IDEBuildOperationMaxNumberOfConcurrentCompileTasks=4 \
OTHER_CFLAGS=”-fembed-bitcode” \
build \
CODE_SIGN_IDENTITY=”” \
CODE_SIGNING_REQUIRED=NO
xcodebuild \
-workspace “xxxx(替换SDK的名字).xcworkspace” \
-scheme “xxxx(替换SDK的名字)” \
-derivedDataPath build \
-sdk iphonesimulator \
-destination ‘platform=iOS Simulator,name=iPhone 6’ \
ONLY_ACTIVE_ARCH=NO \
-configuration Release \
-IDEBuildOperationMaxNumberOfConcurrentCompileTasks=4 \
OTHER_CFLAGS=”-fembed-bitcode” \
build \
CODE_SIGN_IDENTITY=”” \
CODE_SIGNING_REQUIRED=NO
rm -f build/Output/libactor.so
lipo -create “build/Build/Intermediates/xxxx(替换SDK的名字).build/Release-iphoneos/j2objc/Objects/libactor.so” “build/Build/Intermediates/xxxx(替换SDK的名字).build/Release-iphonesimulator/j2objc/Objects/libactor.so” -output build/Output/libactor.so
# Building Framework
# Copy base framework
rm -fr build/Output/xxxx(替换SDK的名字).framework
cp -a build/Build/Products/Release-iphoneos/xxxx(替换SDK的名字).framework build/Output/
# Merging binaries
lipo -create “build/Build/Products/Release-iphoneos/xxxx(替换SDK的名字).framework/xxxx(替换SDK的名字)” “build/Build/Products/Release-iphonesimulator/xxxx(替换SDK的名字).framework/xxxx(替换SDK的名字)” -output build/Output/xxxx(替换SDK的名字)_Lipo
rm -fr build/Output/xxxx(替换SDK的名字).framework/xxxx(替换SDK的名字)
mv build/Output/xxxx(替换SDK的名字)_Lipo build/Output/xxxx(替换SDK的名字).framework/xxxx(替换SDK的名字)
rm -fr build/Output/xxxx(替换SDK的名字).framework/Frameworks
# Merging swift docs
cp -a build/Build/Products/Release-iphonesimulator/xxxx(替换SDK的名字).framework/Modules/xxxx(替换SDK的名字).swiftmodule/* build/Output/xxxx(替换SDK的名字).framework/Modules/xxxx(替换SDK的名字).swiftmodule/
# Copying dSYM
cp -a build/Build/Products/Release-iphoneos/xxxx(替换SDK的名字).framework.dSYM/* build/Output/xxxx(替换SDK的名字).framework.dSYM/
# Compressing Framework
cd build/Output/
rm -f xxxx(替换SDK的名字).zip
zip -r xxxx(替换SDK的名字).zip xxxx(替换SDK的名字).framework xxxx(替换SDK的名字).framework.dSYM