Jeankins+蒲公英自动打测试包
参考文章:https://www.jianshu.com/p/ce36997919b4
最后一步“构建”的shell命令
#工程名 APP_NAME="TextToSpeech" #目标名 TARGET_NAME="文字转语音助手" #证书 CODE_SIGN_DEVELOPER="证书名称" #info.plist路径 project_infoplist_path="/Users/hudun/.jenkins/workspace/文字转语音助手/TextToSpeech/TextToSpeech/Others/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="/Users/hudun/Desktop/ipa/${IPANAME}" #workspace路径 WORKSPACE_PATH="/Users/hudun/.jenkins/workspace/文字转语音助手/TextToSpeech/TextToSpeech.xcworkspace" echo "+++++++++++++++++clean+++++++++++++++++" xcodebuild -workspace ${WORKSPACE_PATH} -scheme "${APP_NAME}" -configuration 'Debug' clean echo "+++++++++++++++++Build+++++++++++++++++" xcodebuild -workspace ${WORKSPACE_PATH} -scheme "${APP_NAME}" -sdk iphoneos -configuration 'Debug' CODE_SIGN_IDENTITY="${CODE_SIGN_DEVELOPER}" SYMROOT='$(PWD)' echo "+++++++++++++++++Run+++++++++++++++++" xcrun -sdk iphoneos PackageApplication -v "./Debug-iphoneos/${APP_NAME}.app" -o ${IPA_PATH} #userKey和apiKey需要在蒲公英的账号设置中查找 userKey="蒲公英平台查看" apiKey="蒲公英平台查看" #蒲公英打包 curl -F "file=@${IPA_PATH}" \ -F "uKey=${userKey}" \ -F "_api_key=${apiKey}" \ -F "isPublishToPublic=2" \ http://www.pgyer.com/apiv1/app/upload