add home to repo
This commit is contained in:
15
home/applications/android-wifi/android-wifi.sh
Normal file
15
home/applications/android-wifi/android-wifi.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Try to connect via scrcpy first
|
||||
if ! scrcpy; then
|
||||
# If scrcpy fails, try the alternative method
|
||||
echo "If scrcpy fails, try the alternative method"
|
||||
adb tcpip 5555 >/dev/null 2>&1 || true
|
||||
MAC="0c:52:03:1e:89:9a"
|
||||
for i in $(seq 1 254); do ping -c1 -W1 192.168.1.$i >/dev/null 2>&1 & done; wait
|
||||
line=$(ip neigh | grep -i "$MAC" | head -n1 || true)
|
||||
ip=$(printf "%s" "$line" | awk '{print $1}')
|
||||
echo "${ip}:5555"
|
||||
adb connect "${ip}:5555"
|
||||
scrcpy
|
||||
fi
|
||||
Reference in New Issue
Block a user