-
Notifications
You must be signed in to change notification settings - Fork 4
/
easy_adb.sh
154 lines (137 loc) · 6.91 KB
/
easy_adb.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
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/bin/bash
alias adb='/Users/ramadan/Library/Android/sdk/platform-tools/adb'
PACKAGE="com.ramadan.takeaway"
print_blue(){
printf "\e[1;34m$1\e[0m"
}
print_red(){
printf "\e[1;31m$1\e[0m"
}
print_green(){
printf "\e[1;32m$1\e[0m"
}
print_yellow(){
printf "\e[1;33m$1\e[0m"
}
while test $# -gt 0; do
case "$1" in
device)
print_blue "\n ==================================== Devices: ===============================\n"
adb devices
print_blue "\n ==================================================================================================\n"
exit 0
;;
package)
print_blue "\n ==================================== Packages: ===============================\n"
adb shell pm list packages
print_blue "\n ==================================================================================================\n"
exit 0
;;
shell)
print_blue "\n ==================================== Device Shell: ===============================\n"
adb shell
print_blue "\n ==================================================================================================\n"
exit 0
;;
command )
print_blue "\n ==================================== ADB Commands: ===============================\n"
adb shell ls /system/bin
print_blue "\n ==================================================================================================\n"
exit 0
;;
feature )
print_blue "\n ==================================== Device Features: ===============================\n"
adb shell pm list features
print_blue "\n ==================================================================================================\n"
exit 0
;;
capture)
print_blue "\n ==================================== Device ScreenShot: ===============================\n"
adb shell screencap /sdcard/screenshot.png
print_green "screen is captured \n"
print_blue "==================================================================================================\n"
exit 0
;;
picture)
print_blue "\n ==================================== Pull ScreenShot: ===============================\n"
adb pull /sdcard/screenshot.png
print_green "check your project root folder\n"
print_blue "==================================================================================================\n"
exit 0
;;
record)
print_blue "\n ==================================== Device Recording: ===============================\n"
adb shell screenrecord /sdcard/record.mp4
print_blue "==================================================================================================\n"
exit 0
;;
video)
print_blue "\n ==================================== Pull Video: ===============================\n"
adb pull /sdcard/record.mp4
print_green "check your project root folder\n"
print_blue "==================================================================================================\n"
exit 0
;;
anim-off)
print_blue "\n ==================================== disable Animation : ===============================\n"
adb shell settings put global window_animation_scale 0
adb shell settings put global transition_animation_scale 0
adb shell settings put global animator_duration_scale 0
print_green "Animation is off\n"
print_blue "==================================================================================================\n"
exit 0
;;
anim-on)
print_blue "\n ==================================== enable Animation : ===============================\n"
adb shell settings put global window_animation_scale 1
adb shell settings put global transition_animation_scale 1
adb shell settings put global animator_duration_scale 1
print_green "Animation is on\n"
print_blue "==================================================================================================\n"
exit 0
;;
clear)
print_blue "\n ==================================== clear App Data : ===============================\n"
adb shell pm clear $PACKAGE
print_green "App Data is Cleared \n"
print_blue "==================================================================================================\n"
exit 0
;;
ip)
print_blue "\n ==================================== IP Address Info : ===============================\n"
adb shell ip addr show
print_blue "==================================================================================================\n"
exit 0
;;
dumpsys)
print_blue "\n ==================================== Dumpsys starting : ===============================\n"
adb shell dumpsys > ~/Desktop/dumpsys.txt
print_green "Dumpsys is generated , check your Desktop \n"
print_blue "==================================================================================================\n"
exit 0
;;
dumpsys-less)
print_blue "\n ==================================== Dumpsys starting : ===============================\n"
adb shell dumpsys | less
print_blue "==================================================================================================\n"
exit 0
;;
battery)
print_blue "\n ==================================== Battery Info : ===============================\n"
adb shell dumpsys battery
print_blue "==================================================================================================\n"
exit 0
;;
uninstall)
print_blue "\n ==================================== Uninstalling : ===============================\n"
adb uninstall $PACKAGE
print_green "uninstall is done \n"
print_blue "==================================================================================================\n"
exit 0
;;
*)
print_red "command is not supported \n"
break
;;
esac
done