Packaging.sh 1.52 KB
Newer Older
1 2


3
#配置以下项
4 5 6
# 工程名
APP_NAME="Lighting"
# 电脑用户名
曹云霄's avatar
曹云霄 committed
7
USER_NAME="caoyunxiao"
8 9
# 证书
CODE_SIGN_DISTRIBUTION="iPhone Distribution: Shanghai Gomore Information Technology Co.,Ltd"
10 11
#描述文件名称
Profile_Name="oppleDis"
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36



# info.plist路径
project_infoplist_path="./${APP_NAME}/Info.plist"

#取版本号
bundleShortVersion=$(/usr/libexec/PlistBuddy -c "print CFBundleShortVersionString" "${project_infoplist_path}")

#取build值
bundleVersion=$(/usr/libexec/PlistBuddy -c "print CFBundleVersion" "${project_infoplist_path}")

#日期
DATE="$(date +%Y%m%d %H:%M:%S)"

#ipa文件名字
IPANAME="${APP_NAME}_V${bundleShortVersion}_${DATE}"

#xcarchive路径
archivePath="/Users/${USER_NAME}/Desktop/App_IOS/archive/${APP_NAME}.xcarchive"

#IPA路径
ipa_path="/Users/${USER_NAME}/Desktop/App_IOS/archive/${IPANAME}"

#要上传的ipa文件路径
曹云霄's avatar
曹云霄 committed
37
echo ${ipa_path}".ipa"> text.txt
38 39 40 41 42 43 44 45 46 47 48 49

echo "=================clean================="
xcodebuild -workspace "${APP_NAME}.xcworkspace" -scheme "${APP_NAME}"  -configuration 'Release' clean


echo "+++++++++++++++++build+++++++++++++++++"
xcodebuild -workspace "${APP_NAME}.xcworkspace" -scheme "${APP_NAME}" -sdk iphoneos -configuration 'Release' CODE_SIGN_IDENTITY="${CODE_SIGN_DISTRIBUTION}" SYMROOT='$(PWD)'

#打包
xcodebuild -archivePath ${archivePath} -workspace "${APP_NAME}.xcworkspace" -sdk iphoneos -scheme "${APP_NAME}" -configuration "Release" archive

#生成IPA
50
xcodebuild -exportArchive -archivePath ${archivePath} -exportPath ${ipa_path} -exportProvisioningProfile "${Profile_Name}"