DEV Community

Cover image for Connect your android device using Wi-Fi on VS Code
FARINU TAIWO
FARINU TAIWO

Posted on

5 1

Connect your android device using Wi-Fi on VS Code

For mobile developers building an Android app, it's important that you always test your app on a real device (phone, tablet) before releasing it to users.

Connecting your device through a USB cord when running your app can be stressful when you are using the device for other things like checking other apps and changing music or charging your device (if it is low). All of these can cause the USB to detach from the device and you will need to connect and run it again when the device is detached.

This solution is too simple, in my opinion. Once your device has been connected to a USB port, you can allow Wi-Fi to maintain the connection.

Android Debug Bridge (ADB) connection is used to connect our Android smartphone to our PC.

Set up a device for development

To set up a device for development read this

Connect to your device using USB

You should already be aware that a USB cable is necessary.

Check you have Android studio installed on your PC and your have installed the SDK Platform Tools.

sdk platform

Verify that your device is connected by running the adb devices command from your android_sdk/platform-tools/ directory. If connected, you'll see the device listed

Make sure the platform-tools directory is present in your environment variable. Adding the directory is required if not.

User variable

For flutter developers, before running your app, check if flutter doctor is working correctly.

Connect to your device using Wi-Fi

Ensure that your workstation or PC and device are connected to the same wireless network.
This wireless network can be established by sharing your PC's hotspot with your android device or vice-versa.

Install extension

  1. Click on the extension tab in the left area on VS Code.

extensions.png

  1. Search for Android ADB WLAN by deskbtm (developer name). Install the extension.

wlandevice

  1. Restart your VS Code. The extension added beside the run button on your VS Code.

run wlan icon.JPG

  1. Click on the icon and select the android device name you want to connect.
  2. Select the number by pressing Enter,
  3. Select the prompted IP address of the WIFI your PC is connected to by pressing Enter.
  4. Connect successfully
  5. Unplug your device and enjoy!

If there is any issue restart the adb by using the extension button and follow the process again.

Thanks for reading. Don't forget to share.

Contact me
Twitter
LinkedIn

Sentry mobile image

Improving mobile performance, from slow screens to app start time

Based on our experience working with thousands of mobile developer teams, we developed a mobile monitoring maturity curve.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay