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
- [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.
- 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).
- [Only de first time] Connect your device over USB.
- 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.
- In VSCode, hit F5 or go to Run > Start Debugging. Enjoy!
Latest comments (0)