Xamarin utilizes the Android Debug Bridge (ADB) for debugging on physical devices, which are usually connected over usb. While this feature definitely is useful, it would sometimes be more practical if you could do this over WIFI instead.
Luckily, that is possible! You can simple switch between using USB and TCP/IP for debugging. To get started, you need to connect your device via USB to the computer you're debugging from. I'm using Windows, so the commands I'll execute the following commands from the commandline (which runs as an administrator), but since they are adb commands, they should be the same on Linux or macOS.
The first command to switch from USB to TCP/IP is
adb tcpip . Replace
After you obtained the IP, connect to the device using adb connect
. After this step, you can disconnect the device from USB. When using
adb devices, this should now list a device at the matching IP address. Visual Studio will now also display the devices IP address in the debugging window.
To switch back from WIFI to USB, simply use
Since this is all based on ADB, debugging over WIFI is not restricted to use with Xamarin & Visual Studio. You can also use this for regular Android apps that are developed with Android Studio!