#开始上传,如果只需要打ipa包出来不需要上传,注释下面的代码 #VV_BUILD_FOR_DEVELOP开发环境,默认上传至蒲公英 if [ "${PREPROCESSOR_DEFINITIONS}"x = "VV_BUILD_FOR_DEVELOP"x ];then echo "........正在上传IPA到蒲公英 ........................" filePath="$ipaPath" echo "***********打印filePath========$filePath" uKey="蒲公英平台ukey" api_key="蒲公英平台api_key" updateDescription="此次更新了哪些功能、描述等等" #上传语法可以到蒲公英文档查看, ipaPath打包后的ipa路径 curl -F "file=@$filePath" -F "uKey=$uKey" -F "_api_key=$api_key" -F "updateDescription=$updateDescription" https://qiniu-storage.pgyer.com/apiv1/app/upload echo "........成功上传IPA到蒲公英 ........................" else #VV_BUILD_FOR_RELEASE生产环境,默认上传至App Store Connect 发布审核 echo "........正在上传到App Store Connect ........................" #开发者账号 Apple_ID="开发者账号" #开发者账号中心生成的双重验证密码 APP_PW="开发者账号中心生成的双重验证密码" #ipa路径 filePath="$ipaPath" ########### 先验证ipa包信息 ########## /Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support/altool --validate-app -f ${filePath} -u ${Apple_ID} -p ${APP_PW} --output-format xml ########### 然后上传至App Store Connect开发者中心 ########## /Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support/altool --upload-app -f ${filePath} -u ${Apple_ID} -p ${APP_PW} --output-format xml echo "........成功上传IPA到App Store Connect ........................" exit 1 fi