Skip to content

Instantly share code, notes, and snippets.

@bashizip
Created September 29, 2019 21:30
Show Gist options
  • Save bashizip/61abcff276e7eb4d5c76c90a2cac6adb to your computer and use it in GitHub Desktop.
Save bashizip/61abcff276e7eb4d5c76c90a2cac6adb to your computer and use it in GitHub Desktop.
connect adb via wifi
Connect the device via USB and make sure debugging is working;
adb tcpip 5555. This makes the device to start listening for connections on port 5555;
Look up the device IP address with adb shell netcfg or adb shell ifconfig with 6.0 and higher;
You can disconnect the USB now;
adb connect <DEVICE_IP_ADDRESS>:5555. This connects to the server we set up on the device on step 2;
Now you have a device over the network with which you can debug as usual.
To switch the server back to the USB mode, run adb usb, which will put the server on your phone back to the USB mode.
If you have more than one device, you can specify the device with the -s option: adb -s <DEVICE_IP_ADDRESS>:5555 usb.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment