Created
December 27, 2019 06:59
-
-
Save vinaywadhwa/3238da4bd93c4fcaf9633333687bbc75 to your computer and use it in GitHub Desktop.
Android Debug Bridge (adb) Wireless Debugging Over Wi-Fi - Switch on wifi debugging in ALL devices connected (via USB, with USB debugging enabled) to your computer (tested on Mac OS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for line in `adb devices | grep -v "List" |grep -v ":" | awk '{print $1}'` | |
do | |
device=`echo $line | awk '{print $1}'` | |
echo "Running commands for $device" | |
echo "Restarting $device in TCP mode on port 5555..." | |
adb -s "$device" tcpip 5555 | |
echo "Waiting for $device to switch to TCP mode..." | |
sleep 7 | |
ip_addr=$(adb -s "$device" shell ip route | grep wlan| grep -o ' 192.*$' | awk '{print $1":5555"}') | |
echo "Connecting to Device via WIFI on $ip_addr" | |
adb -s "$device" connect "$ip_addr" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment