How to debug your Android app over WiFI and say goodbye to cables
Tired on annoying cables? Me too. This is why I love to debug my apps over WiFi, no more cables around! It takes just few minutes to configure it and I’ve added a lot of images so the entire process should be straightforward!
What you need to do it: Requirements.
You don’t need too much to enable the wireless debugging, just:
- Android 11
- Android SDK 30 (if not already installed, you can install it using the Android SDK Manager in Visual Studio)
Do you have everything? Great! So let’s start.
On your phone go in Settings and then in Developer Options:
Enable Wireless ADB debugging and then Wireless debugging. Your phone should show you something like this (of course with data from your actual network):
Tap on Allow to confirm it then click on “Wireless debugging” and Android will show you this page:
Now click on “Pair device with pairing code“. Done? Perfect, now Android will show you a pairing code and the IP address like in this screen:
We are almost ready. Now it’s time to go on your computer. From Visual Studio you can open an Android Adb Command prompt (you can search for it like in the following image):
and write “adb pair” following by the IP and port that your phone showed earlier:
Press enter and your PC should ask you to insert the pairing code. Insert the code showed on your phone. If the code is correct you should receive the message: “Successfully paired to…”
I promise we have almost finished. Now that the device is paired, you need to connect it. To do so, in the same prompt, write “adb connect” followed by your IP and port (Don’t forget the port otherwise the connection will not happen…have a look at the image below).
If everything is correct, you should see the message “Connected to…“. DONE! Now if you go in Visual Studio you can find your new wirelessy connected device in the list of devices:
As you can see my OnePlus is right there ready to allow me to debug with wonderful Xamarin Android apps without any annoying cable. So now it’s your turn to debug your Xamarin apps for Android over WiFi!
It takes few minutes to pair and connect your phone and then finally you don’t need the cable anymore to debug your apps. How cool is that? As usual, if you have any questions, leave a comment here and I’ll quickly reply.
If you have enjoyed this guide, have a look at the others in the blog, there are really interesting articles!