-
Notifications
You must be signed in to change notification settings - Fork 0
/
adb.sh
executable file
·37 lines (32 loc) · 846 Bytes
/
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
#!/data/data/com.termux/files/usr/bin/bash
exec_time() {
# Check if adb is installed
if command -v adb >/dev/null 2>&1; then
echo "adb is installed. Continuing with the script."
else
echo "adb is not installed. Exiting..."
exit 1
fi
# Prompt user for input
read -p "Did you enable wireless debugging (y/n): " qna
# Check user input
if [ "$qna" = "y" ] || [ "$qna" = "Y" ]; then
echo "Enter IP: "
read ip
echo "Enter port: "
read port
# Pair and connect
adb pair "$ip:$port"
sleep 1
echo "Enter the ip: "
read ip_2
echo "Enter port for the second connection: "
read port_2
adb connect "$ip_2:$port_2"
else
echo "Exiting..."
exit 1
fi
}
# Call the function
exec_time