An Interest In:
Web News this Week
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
- April 17, 2024
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
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
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...
Original Link: https://dev.to/takunda/how-to-debug-flutter-apps-over-wi-fiwithout-root-3601
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To