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

Firos K
3 min readMay 27, 2023

--

Courtesy:Internet — — — Wireless Debugging of your Application

Introduction: Are you tired of draining your phone’s battery while testing and debugging your Flutter app? Good news! In this post, I will guide you through the process of connecting your Android device wirelessly to VSCode, allowing you to run and debug your app without the hassle of cables. By following these steps, you’ll be able to optimize your workflow and enhance your development experience. Let’s get started!

Prerequisites: Before we dive in, make sure you have already configured your development environment to run and debug your Flutter app on your Android device over a USB connection. This guide has been tested on an Android 13 device and a Windows 10 computer. Additionally, ensure that both your computer and your phone are connected to the same network.

One-time IDE and Device Configuration:

  1. Install the ADB Commands for VSCode extension:

If you prefer a more visual approach and want to avoid manual configurations, consider installing the ADB Commands for VSCode extension. However, if you are comfortable using adb commands directly, you can skip this step.

2. Enable Wireless debugging on your device:

  • Go to the Settings menu on your Android device.
  • Search for “Developer Options”.
  • Locate and tap on “Wireless debugging.”
  • Toggle the “Use wireless debugging” option to enable it.
  • In the “Allow Wireless debugging on this network” popup, select “Always allow on this network” and tap “Allow.”

Make a note of the “IP Address and Port info” for later use. Note that the port number may vary depending on your device (some tutorials assume it is 5555, but it could be different for your device).

Device Connection:

  1. [First-time setup only] Connect your device via USB: Connect your Android device to your computer using a USB cable.
  2. In VSCode, establish the wireless connection:
  • Press Ctrl+Shift+P to open the command palette in VSCode.
  • Search for and select “ADB: Connect to device IP.”
  • Enter the IP Address of your Android device and press Enter.
  • Provide the Port number that you noted earlier.
  • You should see a toast notification stating “Connected to [device name].” At this point, you can disconnect the USB cable.

Note: The IP Address may vary depending on your network, and the Port number may change each time. Keep this in mind, as it can lead to errors like “ADB returned null value.”

3. Run and Debug your Flutter app:

  • In VSCode, press F5 or navigate to Run > Start Debugging.
  • Now, enjoy the freedom of running and debugging your Flutter app wirelessly!

Conclusion: Congratulations! You have successfully connected your Android device over WiFi to VSCode, enabling seamless running and debugging of your Flutter app. Say goodbye to draining your phone’s battery and embrace the convenience of cable-free development. Utilize this newfound flexibility to enhance your productivity and streamline your app development process. Happy coding!

Say goodbye to constraints and hello to wireless liberation

Photo by Unsplash
Advertisement
Ad — — beingfirozk.xyz

--

--

Firos K

Actively participating in open source communities