forked from gb112211/AndroidTestScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
|
||
# 获取crash日志,存放至crash_log目录下 | ||
|
||
timestamp=`adb shell date +%F_%H-%M-%S | tr -d "\r"` | ||
adb shell dumpsys dropbox | grep data_app_crash > temp.txt | ||
log_dir="./crash_log" | ||
|
||
if [ ! -d "$log_dir" ] | ||
then | ||
mkdir $log_dir | ||
fi | ||
|
||
get_crash_log() | ||
{ | ||
time_list=[] | ||
index=0 | ||
for result in `cat temp.txt | cut -d " " -f 2` | ||
do | ||
time_list[$index]=$result | ||
let "index+=1" | ||
|
||
done | ||
|
||
for time in ${time_list[@]} | ||
do | ||
adb shell dumpsys dropbox --print $time >> $log_dir/$timestamp.log | ||
done | ||
} | ||
|
||
get_crash_log | ||
rm -f temp.txt | ||
echo "Completed..." | ||
|