Last active
December 25, 2015 01:41
-
-
Save tzutalin/5aaedfc13ed7acdf4b60 to your computer and use it in GitHub Desktop.
Use Wifi Adb
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
#!/bin/sh | |
PORT=5555 | |
if [ $# -ne 0 ]; then | |
while [ $# != 0 ] | |
do | |
PORT=$1 | |
shift | |
done | |
fi | |
echo "Ask ADB to listen to Port $PORT" | |
adb tcpip $PORT | |
device_ip=$(adb shell netcfg | egrep -i 'wlan' | awk -F' ' '{print $3}' | awk -F'/' '{print $1}') | |
echo "Android device IP is $device_ip" | |
echo "$device_ip:$PORT" | |
adb wait-for-device | |
adb connect "$device_ip:$PORT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment