-
Notifications
You must be signed in to change notification settings - Fork 0
/
sideload-wifi
executable file
·53 lines (39 loc) · 1009 Bytes
/
sideload-wifi
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
#!/bin/bash
source sideloader-config
osCheck
clearLog
deviceCheck
if [[ $DEVICE == 192* ]]
then
ok "Already connected via wifi."
$ADB devices
dialogLog
exit 0
fi
info "Attempting to find the ip of your quest."
WIFIIP=$($ADB shell ip addr show wlan0 2> /dev/null | grep 'inet ' | cut -d' ' -f6|cut -d/ -f1 | sed '/^$/d') 2> /dev/null
if [ -z "$WIFIIP" ]
then
error "Please connect your quest to the same wifi network as this computer."
dialogLog
exit 0
fi
info "Found the ip of your quest [$DEVICE]."
info "Attempting to change adb to TCPIP mode."
WIFISTART=$($ADB tcpip 5555 | tee /dev/tty)
sleep 2
info "Attempting to connect adb to [$WIFIIP] over TCPIP."
WIFICHECK=$($ADB connect $WIFIIP:5555 | tee /dev/tty)
if [ "$WIFICHECK" == "connected to $WIFIIP:5555" ]
then
ok "ADB over WIFI established successfully [$WIFIIP]"
ok "You may now unplug your cable"
adb devices
dialogLog
exit 0
else
error "ADB over WIFI could not be established.
dialogLog"
exit 1
fi
exit 0