I use a Xiaomi phone for wireless debugging while developing and testing a Flutter app, but the connection is frustratingly unreliable. Sometimes wireless debugging turns itself off only a few seconds after I enable it, while other times it stays active for hours. Is this mainly a Xiaomi or MIUI power-management issue, or do other Android manufacturers have similar problems? If wireless debugging works reliably for you, which phone manufacturer and model are you using?
3 Answers
It may be related to aggressive Wi-Fi or battery-saving behavior. Keeping the connection active with continuous network traffic, such as periodically pinging the phone from a terminal, can sometimes prevent the device from putting the debugging connection to sleep. However, if wireless debugging still shuts off while its settings screen is open, Xiaomi's background-management behavior may be involved as well.
I had the same experience with a Xiaomi Mi 11 Lite. I originally assumed it was an Android Studio problem, but the wireless debugging feature would randomly stop working there too. Xiaomi may be the common factor.
Wireless debugging has been reliable for me on a Samsung Galaxy S25. I use it regularly and haven't experienced the random shutdowns described here, so Samsung may be a better choice if stable wireless development support is important.

That makes Xiaomi seem like the likely culprit, especially since the behavior is so inconsistent.