Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
October 17, 2021 11:17 am GMT

How to debug Flutter apps over Wi-Fi(without root)

Let's just say you want to debug your Flutter app on android device, you use a USB cable right?

Yes but using a USB cable has its downsides

  • If your charging port is loose for some reason, then a slight move will disconnect your app
  • On MacOS is displays a certain annoying "Please install SmartSwitch or some app" message
  • Lack of flexibility
  • Among other annoyances

So lets try debugging over wifi

Debugging over wifi

Debugging over wifi

Requirements

  • Your phone
  • Your machine
  • A USB cable.
  • Your machine and phone should be connected to the same wifi.

Steps

Step 1
Connect your device to your machine using USB

Step 2
Open terminal and type the following

$ adb kill-server$ adb tcpip 5555

This will kill current adb server and create another server which listens on all interfaces.

If it says something like this

* daemon not running; starting now at tcp:5037* daemon started successfullyrestarting in TCP mode port: 5555

Remove phone from mobile device and go to the next step

Step 3
Get you device's wifi IP address. To do this:

Go to
Settings > Connections > Click Wifi Name > View properties(Which has the IP)

Or

Settings > About Phone > Status > IP Address(Which has IP)

Your ip should be something like 192.168.100.X

Step 4
Inside your terminal type

adb connect YOUR_IP:5555

And if it says something like this:

connected to 192.168.100.X:5555

You are good to go

Safety Concerns

Wifi hacks

While this method offers convenience and flexibility, it might not be safe to do it on a public wifi or a wifi that you don't trust. After all someone might be listening in for open ports just to do something crazy, So be careful...

Outro Meme


Original Link: https://dev.to/takunda/how-to-debug-flutter-apps-over-wi-fiwithout-root-3601

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To