Last active
September 9, 2015 09:37
-
-
Save dant3/663c72ddd3f84a58790a to your computer and use it in GitHub Desktop.
ADB over wifi
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/bash | |
PORT=5555 | |
echo "Getting device ip..." | |
PHONE_IP=`adb shell ip -f inet addr show wlan0 | grep inet | cut -d: -f2 | awk '{ print $2 }' | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"` | |
echo "Device ip: $PHONE_IP" | |
echo "Enabling adb tcpip on port $PORT" | |
adb tcpip $PORT | |
echo "adb tcpip enabled. Connecting..." | |
adb connect $PHONE_IP:$PORT | |
echo "Adb over wifi connected. Now you can remove your usb cable." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment