Skip to content

Instantly share code, notes, and snippets.

@rajat1saxena
Last active July 23, 2016 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajat1saxena/f46cd326e68da19c6221f1ae5d6b4eac to your computer and use it in GitHub Desktop.
Save rajat1saxena/f46cd326e68da19c6221f1ae5d6b4eac to your computer and use it in GitHub Desktop.
#!/bin/bash
# Get the IP of the connected android device
IP=`adb shell netcfg | grep wlan0 | awk '{ print $3 }' | awk -F'/' '{ print $1 }'`
# Port used for connecting, on device. Change as required
DEBUG_PORT='5555'
# Start the adb as tcpip deamon
adb tcpip $DEBUG_PORT
# Connect wirelessly using above settings
adb connect $IP:$DEBUG_PORT
echo 'You can use the following command, in case you get disconnected as soon as you disconnect the USB\n'
COMMAND="adb connect $IP:$DEBUG_PORT"
echo $COMMAND
echo 'You are good to go\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment