-
Notifications
You must be signed in to change notification settings - Fork 14
/
info.sh
executable file
·52 lines (46 loc) · 949 Bytes
/
info.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
#!/bin/bash
#
# Created by Sujay Davalgi
#
# Displays the BrokerService info of the device
#
# Usage: ./info.sh [<command info>]
# Command line Arguments (Optional):
# $1 - mIsMaster
# address:
# name:
# placeName:
. ./library/mainFunctions.sh
. ./library/textFormatting.sh
. ./library/deviceOperations.sh
getDeviceChoice
displaySelectedDevice $deviceSerial
if [ $( isAdbDevice $deviceSerial ) == "true" ]; then
if [ $# -lt 1 ]; then
adb -s $deviceSerial wait-for-device shell dumpsys activity service BrokerService
else
opt="$1"
case $opt in
master)
cmd="mIsMaster"
;;
ip)
cmd="address:"
;;
name)
cmd="name:"
;;
palce)
cmd="placeName:"
;;
*)
echo -e "\n Invalid option in the argument...\n"
exit 1
;;
esac
./adb -s $deviceSerial wait-for-device shell dumpsys activity service BrokerService | grep ${cmd}
echo ""
fi
else
echo " Device is not in 'adb' mode"
fi