Skip to content

Commit 21b3a22

Browse files
committed
Script to Get the Kernel logs
1 parent 12b4a43 commit 21b3a22

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

kernelLogcat.sh

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

0 commit comments

Comments
 (0)