DEV Community

Cover image for Connect Your Android Device Over WiFi in VSCode to Run and Debug Your Flutter App
Sebastián Rojas Ricaurte
Sebastián Rojas Ricaurte

Posted on • Originally published at Medium

Connect Your Android Device Over WiFi in VSCode to Run and Debug Your Flutter App

Stop damaging your phone's battery to test your apps, debug without cables (almost).

This post assumes that you have already configured your development environment to run and debug on your Android device over a USB connection. Tested on an Android 13 device and a Windows 10 computer. You need to have both your computer and your phone connected to the same network.

One time IDE and device configuration

  1. [Optional] Install the ADB Commands for VSCode extension. If not, you can use adb commands. I prefer to use the extension because I don't need to configure nothing and is more visual.
  2. Enable Wireless debugging in your device:
    • Go to Settings and search for "debug".
    • Tap on "Wireless debugging", then again in the "Wireless debugging" option (not in the toggle, tap the entire item to enter to the details page.
    • Check the "Use wireless debugging" toggle. In the "Allow Wireless debugging on this network" popup you should check "Always allow on this network" and tap on "Allow".
    • Reserve for later the "IP Address and & Port info" (most tutorials assume that port is 5555 but in my brand new Pixel 7 it was another port number). Image description

Device conection

  1. [Only de first time] Connect your device over USB.
  2. In VSCode, hit Ctrl+shift+p, look for and select "ADB:📱 Connect to device IP":
    • Type the IP Address and hit enter.
    • Type the Port number
    • You should see a toast with "Connected to :". Now you can disconnect the USB cable. *Note: IP Address changes deppending of the used network and router device configuration. Port number could change each time. This can cause "ADB returned null value" or others errors.
  3. In VSCode, hit F5 or go to Run > Start Debugging. Enjoy!

Top comments (1)

Collapse
 
adasdadadasdad profile image
asdsadasdadad

adb error null this does not work

device does not shown up in devices list