Android Studio Wireless Debugging in 5 min

Md. Hasnain
3 min readSep 18, 2020

Wireless charging is very popular now-a-days. So, why not wireless debugging! The era of USB debugging is over (well, almost over :p). It’s an old trick and old is gold you know.

Let’s fight:

  1. Initializing the wireless debugging process:

    ✓ Connect your device and PC in same network (it’s must)
    ✓ Connect your device with PC using USB (opps)
    ✓ Open cmd and run: adb tcpip 5555

    If you see that adb is not recognized as internal or external command, your adb is not set up globally. Set up adb globally by following the steps written in the bottom of this tutorial.
  2. Get your device’s IP address:

    ✓ Open cmd and run adb shell netcfg or adb shell ifconfig(android version with 6.0 or higher)
    ✓ From the result you will see a part with wlan0
    ✓ Here you will see something like inet addr:192.168……. This is your DEVICE_IP_ADDRESS

    To find the IP address while using OSX run the command adb shell ip route
  3. Now connect:

    ✓ In cmd: adb connect DEVICE_IP_ADDRESS:5555

    That’s all! You can now remove the USB and run the app from Android studio or any other way!
    For connecting more than one device (this one is actually more useful though :p)

    ✓ Disconnect any previous connection by following step 4
    ✓ Restart the adb server by adb tcpip 5555
    ✓ Connect a device with USB and find the ip using step 2
    ✓ In cmd: adb -d connect DEVICE_IP_ADDRESS:5555
    ✓ Device connected! Remove the USB and connect the next device with USB, find the ip and connect using adb -d connect DEVICE_IP_ADDRESS:5555
    ✓ Connect as much as device you want. Fun right!!
  4. Disconnect:
    After debugging done disconnect the device using:

    ✓ In cmd: adb disconnect DEVICE_IP_ADDRESS:5555

    WARNING: leaving the option enabled is dangerous. Anyone in your network can connect to your device in debug, even if you are in data network. Do it only when connected to a trusted Wi-Fi and remember to disconnect it when done!

Set up adb(Android Debug Bridge) globally:
We need to set a path variable to use adb from anywhere. Don’t be frightened or bored, it’s super easy. The adb is normally located here if you didn’t installed you sdk other than Local Disk(C :): Go to:
Local Disk(C :) -> Users -> (Username) -> AppData -> Local -> Android -> sdk -> platform-tools

✓ Copy this folder’s path
✓ Now right click on (My Computer/This PC), select properties
✓ A window will be opened with your PC’s basic info
✓ From the left panel of this window select ‘Advanced system settings’
✓ Another dialog will be opened -> select ‘Advanced’ tab -> Click ‘Environment Variables…’(at the bottom of the dialog)
✓ Another dialog will be opened. From the upper part double click on ‘Path’
✓ In windows version <10 place a ‘;’ and paste the path here
✓ In windows version 10 click on ‘New’ and paste the path.
✓ Now click on all three ‘ok’ buttons and we are done!

--

--

Md. Hasnain

Programming is my hobby and Android is my passion :) . I am a professional Mobile Application Developer(Native and cross platform).