Created
November 27, 2019 07:40
-
-
Save Muneefm/b6bee9f226c6d1a150a2fc4f4ee3b98f to your computer and use it in GitHub Desktop.
Shell script to connect android device through wifi using adb when connected through usb
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
# Script to grep ip address of connected adb device and connect them through network | |
ip_addr=$(adb shell ip addr show wlan0 | grep "inet\s" | awk '{print $2}' | awk -F'/' '{print $1}' ) | |
echo $ip_addr | |
port=`5555` | |
adb tcpip $port | |
adb connect $ip_addr | |
adb devices |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment