#!/bin/bash
function getTimestamp() {
date "+%Y%m%d_%H%M%S"
}
#function1 getTimestamp1() {
# date "+%Y%m%d"
#}
echo "请输入每段日志记录时长(分钟单位):"
read time
function logLog() {
timestamp=$(getTimestamp)
#timestamp1=$(getTimestamp1)
echo "start:"$timestamp
#mkdir log_data/timestamp1
adb logcat -c
adb logcat -v time > log_data/20211117/$timestamp.txt & { sleep $(($time*60)); kill $! & }
timestamp=$(getTimestamp)
echo "end:"$timestamp
}
while [ 1 ]; do
logLog
done
自动分时段保留logcat脚本
最新推荐文章于 2024-01-09 16:56:45 发布