3、iOS jenkins持續集成之shell腳本打包

Execute shell打包,在上邊介紹基礎上增長shell腳本打包

# 工程名
TARGET_NAME=""
# 文件名前綴
APP_NAME=""
# 證書
CODE_SIGN_DISTRIBUTION="iPhone Distribution: TEST TEST Technology Co., Ltd."
# info.plist路徑
project_infoplist_path="./${TARGET_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)"
IPANAME="${APP_NAME}_V${bundleShortVersion}_${DATE}.ipa"
#要上傳的ipa文件路徑
IPA_PATH="$HOME/Desktop/jenkins包/${IPANAME}"
echo ${IPA_PATH}
echo "${IPA_PATH}">> text.txt#下面2行是集成有Cocopods的用法
echo "=================clean================="
xcodebuild -workspace "${TARGET_NAME}.xcworkspace" -scheme "${TARGET_NAME}" -configuration 'Release' clean
echo "+++++++++++++++++build+++++++++++++++++"
xcodebuild -workspace "${TARGET_NAME}.xcworkspace" -scheme "${TARGET_NAME}" -sdk iphoneos -configuration 'Release' CODE_SIGN_IDENTITY="${CODE_SIGN_DISTRIBUTION}" SYMROOT='$(PWD)'
xcrun -sdk iphoneos PackageApplication "./Release-iphoneos/${TARGET_NAME}.app" -o ${IPA_PATH}複製代碼

相關文章
相關標籤/搜索