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" |