-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc_helper_functions
64 lines (58 loc) · 1.23 KB
/
zshrc_helper_functions
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
bounds() {
if "$1" = true
then
adb shell setprop debug.layout true
else
adb shell setprop debug.layout false
fi
adb shell service call activity 1599295570
}
deeplink() {
adb shell am start -a android.intent.action.VIEW -d "$1"
}
skiagl() {
adb shell su
adb shell setprop debug.hwui.renderer skiagl
adb shell stop
adb shell start
}
ss() {
if [ $# -eq 0 ]
then
name="`date '+%d-%m-%Y-time-%H-%M-%S'`.png"
else
name="$1.png"
fi
adb shell screencap -p /sdcard/$name
adb pull /sdcard/$name
mv ./$name ~/Documents/androidss/
adb shell rm /sdcard/$name
}
rec() {
if [ $# -eq 0 ]
then
echo "You need to enter filename (mp4 will be added as suffix)"
else
name="$1.mp4"
echo "Video recording started with the name of $1.mp4. You can get the file with get_file $1.mp4"
adb shell screenrecord --bit-rate 7000000 /sdcard/$name
fi
}
get_file() {
if [ $# -eq 0 ]
then
echo "You need to enter filename"
else
adb pull /sdcard/$1
mv ./$1 ~/Documents/androidss/
adb shell rm /sdcard/$name
fi
}
charles() {
if "$1" = true
then
adb shell settings put global http_proxy $(ipconfig getifaddr en0):8888
else
adb shell settings put global http_proxy :0
fi
}