-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystemuilog
More file actions
executable file
·66 lines (58 loc) · 1.54 KB
/
systemuilog
File metadata and controls
executable file
·66 lines (58 loc) · 1.54 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# Nome: Zhenlei Ji
# Email: zhenlei.ji@gmail.com
#
# Easy way to enable log on systemui without reboot.
# HOW TO USE
# TAG - tag name, e.g. ZenModePanel, usually it is class name.
# priority - the priority of log, could be (default: V):
# v - Verbose (lowest priority)
# d - Debug
# i - Info
# w - Warning
# e - Error
# f - Fatal
# s - Silent (highest priority, on which nothing is ever printed)
# Commands:
# ~$ ./systemuilog [TAG] [priority]
#
# Example 1:
# ~$ ./systemuilog ZenModePanel
#
# Example 2:
# ~$ ./systemuilog ZenModePanel w
# Handle input arguments
if [ -z "$1" ]; then
echo "ERROR: No argument supplied"
else
# Set priority
PRIORITY="VERBOSE"
if [ -n "$2" ]; then
if [ "$2" == "d" -o "$2" == "D" ]; then
PRIORITY="DEBUG"
elif [ "$2" == "i" -o "$2" == "I" ]; then
PRIORITY="INFO"
elif [ "$2" == "w" -o "$2" == "W" ]; then
PRIORITY="WARNING"
elif [ "$2" == "e" -o "$2" == "E" ]; then
PRIORITY="FATAL"
elif [ "$2" == "f" -o "$2" == "F" ]; then
PRIORITY="SILENT"
fi
fi
fi
echo "Enabling $1 log with $PRIORITY priority ."
# Set root mode
adb root
# Delay to connect
sleep 1
# Waiting for connection
while [ `adb devices | wc -l` -ne 3 ]; do
sleep 1
done
# Get pid of systemui process
PID=`adb shell ps | grep systemui | tr -s [:space:] ' ' | cut -d' ' -f2`
# Kill the process, so systemui process will restart
adb shell kill -9 $PID
adb shell setprop log.tag.$1 $PRIORITY
echo "Done."