ios ipa命令打包

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!/bin/sh
# build.sh
# 
# 注意目录的空格
# 注意sh权限和mobileprovision的权限
# SIGN可以从钥匙串中获取
PROJDIR=~/Documents/rwli/project/xxxxxxx
TARGET_NAME="xxxxxxx"
TARGET_SDK="iphoneos"
PROJECT_BUILDDIR="${PROJDIR}/build/Release-iphoneos"
TARGET_TEST_NAME="UnitTests"
BUILD_TARGET_DIR=~/Documents/rwli/temp
SIGN="iPhone Distribution: SHENZHEN xxxxxxxxxxx (xxxxxxxx)"
PROVISONNING_PROFILE=~/Documents/rwli/publish/xxxxxx.mobileprovision
 
# compile project
echo "###############Building Project#################"
cd "${PROJDIR}"
xcodebuild -target "${TARGET_NAME}" -sdk "${TARGET_SDK}" -configuration Release
#Check if build succeeded
if [ $? != 0 ]
then
  exit 1
fi
echo "#################Build Ipa################"
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${PROJECT_BUILDDIR}/${TARGET_NAME}.app" -o "${BUILD_TARGET_DIR}/${TARGET_NAME}.ipa" --sign "${SIGN}" --embed "${PROVISONNING_PROFILE}"