!/bin/sh
设置项目路径和输出目录
project_path="../../项目名"
output_directory="../../项目名/build"
清理旧的构建文件
xcodebuild clean -workspace "$project_path/工程名.xcworkspace" -scheme "工程名" -configuration Debug -sdk iphoneos
编译并打包应用程序
xcodebuild archive -workspace "output_directory/工程名.xcarchive" -configuration Debug -sdk iphoneos
echo "到这里就可以改代码啦"
导出IPA文件(需配置exportOptions.plist文件)
xcodebuild -exportArchive -archivePath "output_directory/ipa" -exportOptionsPlist "exportOptions.plist" -allowProvisioningUpdates
检查 IPA 文件是否存在
ipa_path="ipa_path" ]; then
echo "IPA 文件地址: $ipa_path"
else
echo "IPA 生成失败"
exit 1
fi
上传 IPA 文件到蒲公英
echo "地址$ipa_path"
询问用户输入
echo "请输入本次更新内容(60秒内未输入将自动跳过)"
read -t 60 update_input || update_input="更新"
echo "本次更新内容:$update_input"
请替换 YOUR_PGYER_API_KEY 为你的蒲公英 API Key
(下载蒲公英脚本放到同级目录)
./pgyer_upload.sh -k "YOUR_PGYER_API_KEY" -d ipa_path