Debugging your Android app over Wifi!!
Shivam Ahuja
SDE at Spinny || Backend Developer || Python( Django ) || Java || Flutter Developer
Its always been difficult for me to debug my app on a physical device via USB debugging, so here is something you can do to debug your app over Wifi
Step 1. Turn on USB debugging on your android device:
Goto developer options and turn on USB debugging , if you cannot find the developer options go to your device Settings > About Phone, Now tap Build Number seven times. Congratulations You’re now a developer ??
Step 2. Install adb: open cmd and type
adb
If you see no error then well and good , but if you encounter some error like "adb command is not recognizable" then, go to
C:\Users\[user]\AppData\Local\Android\Sdk\platform-tools
where user is your username for windows. there you can see the adb.exe
Copy the current path and go to start and type env , now in user variables section find "path" variable . Double tap on path variable and click new , now paste the path that you copied earlier and click OK . Now open cmd again and type adb again , you will see something like this
Now type
adb devices
Now you can see your Android Device, saying on command prompt list of device. and then some of your device properties and alias.
Now type
adb tcpip 5555
You can see the message starting adb at port 5555. Now go to your Phone’s Wifi settings and look for the IP Address of the phone (Make sure that your android device and laptop are connected to the same Wifi). Now type
adb connect <ip_address_of_your_phone>:5555
The ip_address_of_your_phone look like 192.168.x.x , You are now connected and you can disconnect the USB cable. And continue developing your apps without the headache of disconnecting USB cable.
For disconnecting your device just type
adb kill-server