## ipa路径 file_ipa="${path_app}/${project}-$(date "+%Y%m%d%H%M").ipa" if [[ -n "${project_name}" ]] then mv"${path_app}/${project_name}.ipa""${file_ipa}" else mv"${path_app}/${project}.ipa""${file_ipa}" fi
## 判断导出ipa结果 if [ -f "${file_ipa}" ] then echo"** Finished export. Elapsed time: ${SECONDS}s **" rm -rf "$path_build" echo$file_ipa say "iOS打包成功"
if [[ -n "${pgyer_api_key}" ]] then #上传到pgyer echo"正在上传到蒲公英..." echo curl -F "file=@${file_ipa}" -F "_api_key=${pgyer_api_key}" -F "buildInstallType=2" -F "buildPassword=${pgyer_pwd}" -F "buildUpdateDescription=脚本自动上传" https://www.pgyer.com/apiv2/app/upload # rm -rf ${file_ipa} echo say "iOS上传蒲公英成功" echo if [[ -n "${pgyer_subfix_url}" ]] then open https://www.pgyer.com/${pgyer_subfix_url} fi else open $path_app fi else echo"遇到报错了😭, 打开Xcode查找错误原因" say "iOS打包失败" exit 1 fi
if [[ -f app/${file_apk} ]] then say "android打包成功"
if [[ -n "${pgyer_api_key}" ]] then #上传到pgyer echo"正在上传到蒲公英..." echo curl -F "file=@app/${file_apk}" -F "_api_key=${pgyer_api_key}" -F "buildInstallType=2" -F "buildPassword=${pgyer_pwd}" -F "buildUpdateDescription=脚本自动上传" https://www.pgyer.com/apiv2/app/upload # rm -rf app/${file_ipa} echo say "android上传蒲公英成功" echo if [[ -n "${pgyer_subfix_url}" ]] then open https://www.pgyer.com/${pgyer_subfix_url} fi else open app fi else echo"遇到报错了😭, 打开Android Studio查找错误原因" say "android打包失败" fi
echo"📅 Finished. Elapsed time: ${SECONDS}s" fi ##==================================apk==================================
##==================================ipa================================== if [[ ${platform} -ne 1 ]]; then echo"开始build ios" flutter build ios $obfuscate --release --verbose #--no-codesign echo"build ios已完成"
build_ios fi ##==================================ipa==================================