Can we do Flutter App Development Wireless ? Without connecting USB cable from Mobile to laptop?

626

Solution 1

Yes, It is possible to wirelessly debug your application through adb over wifi.

  1. Make sure your development machine and your device is on the same wifi network
  2. Connect your device via USB
  3. On console type : adb tcpip 5555
  4. Disconnect USB and find the IP of your testing device (Settings -> About Phone -> IP Address)
  5. On console type : adb connect YOUR_IP_ADDRESS

For future convenience you may assign a static IP address to your testing device on the router.

Solution 2

Pure WiFi Solution (No USB Cable Required)

In Android version 11 and later, you can connect ADB and test Flutter apps on your phone without a USB cable, using WiFi pairing.

  1. Enable developer options on your device if necessary and go to "Settings -> System -> Developer Options -> Wireless debugging".
  2. Enable wireless debugging and click on "Pair device with pairing code", which shows an IP address, port, and pairing code.
  3. Run adb pair <ip>:<port> <pairing code> to pair with your device.
  4. Go back to the main "Wireless debugging" settings, which shows your same device IP but a different port, and then run adb connect <ip>:<different port> to connect ADB to your device.
  5. You should now see your device listed in the output of adb devices and flutter devices.
  6. Deploy your app to your device by running flutter run -d <ip> in your app folder, where <ip> is your device IP from the previous steps.

(I have a phone that won't connect over USB for some reason, so I needed this. The official Google docs I linked to above don't mention the adb connect step, which caused me much confusion.)

Solution 3

First, connect your phone to the laptop with a USB cable and ensure that you are able to debug. Then type this in your terminal or powershell window-

adb tcpip 5555

Unplug the USB cable and ensure that you are on the same wifi network (hotspots will work as well). Go to Settings > About Phone > Status Information and find your phone's IP address in the IP address section. Assuming your IP is 192.168.1.3, type the following in your terminal-

adb connect 192.168.1.3:5555

Remember that you have to repeat these steps everytime you restart your phone

Share:
626
dharmik98
Author by

dharmik98

I just pursued my Bachelor of Engineering degree in I.T. field. Now work as Jr Software Developer and perform projects on Machine Learning &amp; Natural Language Processing. I have quite good knowledge of Java, python3 and Hadoop. And want to be a Data Scientist.

Updated on December 29, 2022

Comments

  • dharmik98
    dharmik98 over 1 year

    We have to attach mobile with the laptop through USB cable during development. Because, often usb cable got disconnect and mobile connection got lost and again need to install whole App.

    Is there any option do it wireless ?

    through wifi or hotspot something ?

  • pragmateek
    pragmateek about 3 years
    In new phones which are running Android 11, have a new feature called "Wireless Debugging". With that you don't have to connect your phone using USB cable, not even once.