cd /Users/huchu/Desktop/xxx项目/crash
# 崩溃文件:从手机 设置-》隐私-〉分析与改进-》分析数据 获取
crashFile='/Users/huchu/Desktop/xxx项目/1.0.7/crash/XXProjectIOS-2021-04-08-151457.ips.beta'
dysmFile='/Users/huchu/Desktop/xxx项目/1.0.7/crash/Users/huchu/product/commercial_ios_libs/XXProjectIOS/package/Dsym/XXProjectIOS.app.dSYM'
appexecFile='/Users/huchu/Desktop/xxx项目/1.0.7/jenkinspackage/Payload/XXProjectIOS.app/XXProjectIOS'
dysmFileDir='/Users/huchu/Desktop/xxx项目/1.0.7/crash'
# 打印dsym文件的uuid
dwarfdump --uuid $dysmFile
# 打印app的uuid
dwarfdump --uuid $appexecFile
# 解析crash日志
# ./symbolicatecrash $crashFile /Users/huchu/Desktop/xxx项目/1.0.7/crash/XXProjectIOS.app.dSYM.zip >"${crashFile%.ips*}.txt"
dsymFileArr=()
for file in $dysmFileDir/*; do
file1=${file%%.ips}
extName=${file#"$file1"}
if [ ${#extName} -gt 0 ]; then
# echo $file
dsymFileArr[${#dsymFileArr[@]}]=$file
fi
file1=${file%%.ips.beta}
extName=${file#"$file1"}
if [ ${#extName} -gt 0 ]; then
# echo $file
dsymFileArr[${#dsymFileArr[@]}]=$file
fi
done
echo ${dsymFileArr[@]}
for crashFile in ${dsymFileArr[@]}; do
./symbolicatecrash $crashFile /Users/huchu/Desktop/xxx项目/1.0.7/crash/XXProjectIOS.app.dSYM.zip >"${crashFile%.ips*}.txt"
done
参考资料:
shell字符串截取:https://blog.csdn.net/ljianhui/article/details/43128465
shell获取字符串长度:https://www.cnblogs.com/liujiacai/p/7828568.html
shell数组遍历:https://blog.csdn.net/jingwen3699/article/details/82114603
shell条件判断:https://blog.csdn.net/wxc_qlu/article/details/82826106
网友评论