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

Viewed 1402

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 ?

4 Answers

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.

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.)

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

first you must download the SDK Plateform tools https://developer.android.com/studio/releases/platform-tools and extract the file.

after extracting the file, open this file in cmd and run : adb tcpip 5555, adb connect your_ip_adress:5555 make sur you device is connected to the same wireless and the last command is flutter run to run the app

Related