TARGET_NAME=""
APP_NAME=""
CODE_SIGN_DISTRIBUTION="iPhone Distribution: TEST TEST Technology Co., Ltd."
project_infoplist_path="./${TARGET_NAME}/Info.plist"
bundleShortVersion=$(/usr/libexec/PlistBuddy -c "print CFBundleShortVersionString" "${project_infoplist_path}")
bundleVersion=$(/usr/libexec/PlistBuddy -c "print CFBundleVersion" "${project_infoplist_path}")
DATE="$(date +%Y%m%d)"
IPANAME="${APP_NAME}_V${bundleShortVersion}_${DATE}.ipa"
IPA_PATH="$HOME/Desktop/jenkins包/${IPANAME}"
echo ${IPA_PATH}
echo "${IPA_PATH}">> text.txt
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}複製代碼