Created
June 5, 2019 17:57
-
-
Save lucianomlima/d2bffb57bf028f9ef5bb7ef109878200 to your computer and use it in GitHub Desktop.
Connect to Android devices with ADB through wi-fi
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
function adb_connect { | |
# PORT used to connect. Default: 5555 | |
PORT=${1:-5555} | |
# IP address from current device connected | |
IP_ADDRESS=`adb shell ip route | awk '{print $9}'` | |
echo "ADB connect to $IP_ADDRESS on port $PORT" | |
# Change connection from usb to tcpip using $PORT | |
adb tcpip $PORT | |
# Connect to device | |
adb connect "$IP_ADDRESS:$PORT" | |
echo "Done!" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
o device precisa ser rooteado?