#!/bin/bash
num=17
while [ $num ]
do
adb shell "echo -e 'at+xlog=4\n\r' >dev/gsmtty21"
echo "send command"
sleep 250
let num=num+1
echo $num
adb pull /sdcard/logs/ /home/matthew/1207/1205$num/
adb shell 'rm -r /sdcard/logs/* 2>&1'|grep "No such file or directory"
if [ $? -eq 0 ]
then
adb reboot
sleep 200
else
adb pull /logs/aplog /home/matthew/1207/1205$num
adb pull /logs/aplog.1 /home/matthew/1207/1205$num
adb pull /logs/aplog.2 /home/matthew/1207/1205$num
adb pull /logs/aplog.3 /home/matthew/1207/1205$num
adb pull /logs/aplog.4 /home/matthew/1207/1205$num
adb pull /logs/aplog.5 /home/matthew/1207/1205$num
adb pull /logs/aplog.6 /home/matthew/1207/1205$num
adb pull /logs/aplog.7 /home/matthew/1207/1205$num
adb pull /logs/aplog.8 /home/matthew/1207/1205$num
adb pull /logs/aplog.9 /home/matthew/1207/1205$num
adb shell 'rm -rf /logs/aplog.1'
adb shell 'rm -rf /logs/aplog.2'
adb shell 'rm -rf /logs/aplog.3'
adb shell 'rm -rf /logs/aplog.4'
adb shell 'rm -rf /logs/aplog.5'
adb shell 'rm -rf /logs/aplog.6'
adb shell 'rm -rf /logs/aplog.7'
adb shell 'rm -rf /logs/aplog.8'
adb shell 'rm -rf /logs/aplog.9'
fi
done
num=17
while [ $num ]
do
adb shell "echo -e 'at+xlog=4\n\r' >dev/gsmtty21"
echo "send command"
sleep 250
let num=num+1
echo $num
adb pull /sdcard/logs/ /home/matthew/1207/1205$num/
adb shell 'rm -r /sdcard/logs/* 2>&1'|grep "No such file or directory"
if [ $? -eq 0 ]
then
adb reboot
sleep 200
else
adb pull /logs/aplog /home/matthew/1207/1205$num
adb pull /logs/aplog.1 /home/matthew/1207/1205$num
adb pull /logs/aplog.2 /home/matthew/1207/1205$num
adb pull /logs/aplog.3 /home/matthew/1207/1205$num
adb pull /logs/aplog.4 /home/matthew/1207/1205$num
adb pull /logs/aplog.5 /home/matthew/1207/1205$num
adb pull /logs/aplog.6 /home/matthew/1207/1205$num
adb pull /logs/aplog.7 /home/matthew/1207/1205$num
adb pull /logs/aplog.8 /home/matthew/1207/1205$num
adb pull /logs/aplog.9 /home/matthew/1207/1205$num
adb shell 'rm -rf /logs/aplog.1'
adb shell 'rm -rf /logs/aplog.2'
adb shell 'rm -rf /logs/aplog.3'
adb shell 'rm -rf /logs/aplog.4'
adb shell 'rm -rf /logs/aplog.5'
adb shell 'rm -rf /logs/aplog.6'
adb shell 'rm -rf /logs/aplog.7'
adb shell 'rm -rf /logs/aplog.8'
adb shell 'rm -rf /logs/aplog.9'
fi
done