//描述文件名字
SIGN_IDENTITY="iPhone Distribution: GoDo International Science and Technology Culture Co., Ltd. (982G5KLN8Q)"
//证书名字
PROFILE="27f9044c-9f7a-4a29-affa-51c6950692be"
//Release 或 develop
BRANCHNAME=Release
//项目名字
SCHEMENAME=BigSport
DATE=$(date +%H-%M-%S)
SOURCEPATH=$(cd "$(dirname $0)"&&pwd)
IPAPATH=$SOURCEPATH/AutoBuildIPA/$(date +%Y-%m-%d)
IPAPATH_BUILD=$SOURCEPATH/AutoBuildIPA/$(date +%Y-%m-%d)/Build
IPANAME=${SCHEMENAME}-$DATE.ipa
if [ -e $IPAPATH_BUILD/* ]; then
mv $IPAPATH_BUILD/* ~/.Trash
if [ $? -ne 0];then
echo "erroe:Delete trash files failed!!"
exit 1
fi
fi
xcodebuild \
-workspace $SOURCEPATH/$SCHEMENAME.xcworkspace \
-scheme $SCHEMENAME \
-configuration $BRANCHNAME \
clean \
build \
CODE_SIGN_IDENTITY="$SIGN_IDENTITY" \
PROVISIONING_PROFILE=$PROFILE \
-derivedDataPath $IPAPATH_BUILD
xcrun -sdk iphoneos PackageApplication \
-v $IPAPATH_BUILD/Build/Products/$BRANCHNAME'-iphoneos'/$SCHEMENAME.app \
-o $IPAPATH/$IPANAME
if [ -e $IPAPATH/$IPANAME ]; then
open $IPAPATH
else
echo 'Create IPA failed!'
fi
下载地址
https://pan.baidu.com/s/1i5dkt4D