-
Notifications
You must be signed in to change notification settings - Fork 14
/
kernelLogcat.sh
executable file
·32 lines (28 loc) · 1014 Bytes
/
kernelLogcat.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Created by: Sujay Davalgi
#
# Displays the kernel logcat in the terminal
# If argument was provided while initiating the command, it will also save the output in a specified file
#
# Usage: ./kernelLogcat.sh [<filename>]
# Arguments (Optional):
# $1 - File name to be saved as.
# No necessary to give the extension, by default it will save as ".txt"
# If, filename is not provided, it will only display the logcat and not save the output to a file
. ./library/mainFunctions.sh
. ./library/textFormatting.sh
. ./library/deviceOperations.sh
. ./library/logFunctions.sh
getDeviceChoice
displaySelectedDevice $deviceSerial
if [ $( isAdbDevice $deviceSerial ) == "true" ]; then
if [ $# -lt 1 ]; then
adb -s $deviceSerial logcat -v threadtime
else
fileName="`echo $( getFormatedFileName $deviceSerial "$1" )`"
echo -e " Your file will be saved in folder : ${myLogs} as : ${fileName}-logcat.txt \n"
saveKernelLogcat $deviceSerial ${fileName}
fi
else
echo " Device is not in 'adb' mode"
fi