'Cannot debug MAUI on my Android phone via WiFi

Since the Android device emulator that comes with Visual Studio never works for me and Microsoft won't fix it (or release their fix, which is the same to me), I'm trying to debug my apps on my Android phone directly. (Sooner or later I'd need to do that anyway.) I'd like to use the WiFi debugging option because my USB port is usually dust-protected and I don't want to take off the cover every time.

I followed these instructions and could pair the device to my computer (it's also listed on the phone now), but connecting fails. The command says: The connection was refused by the target computer. (Translated to English myself) Nothing more.

What is the issue and what can I do? Are there better instructions available that don't involve typing in magic commands? I see all sorts of remote support for iOS directly in Visual Studio but nothing for Android except the broken emulator. (I have nothing to do with Apple products, so I'm not interested in that.)

I have just upgraded to the latest Visual Studio 2022 17.2.0 Preview 1.0 on Windows 10 on a Surface Pro 4. My Android device is a Samsung S10e with the latest updates and Android 12. There is no network security software installed, just the basic features that come with Android and Windows already.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source