I am working on an app so need to connect to the device through wireless pairing. I frequently put the device in flight mode and this turns off the wireless option as desired. But when I switch off the flight mode, the wireless debugging option remains disabled. What's more, after manually enabling the wireless debugging, the IP port gets changed so I have to connect via adb connect and give the new IP port address every time.

Is there any way to make the device automatically enable the wireless option after the flight mode is deactivated (if it was enabled previously)? Or at least to force the device to use the same port number every time?

  • 1
    The IP of the device is defined by the DHCP server available in the used Wifi (for consumer devices usually the Wifi router also provides the DHCP server). If it changes it is not the fault of Android.
    – Robert
    Jan 26, 2022 at 12:22
  • @Robert It's not about the IP. But when using the pairing method, the port changes randomly, too. It's no longer fixed to port 5555 like it used to be without pairing.
    – Mario
    Jan 26, 2022 at 21:36
  • do not put device in flight mode while adb over wifi
    – alecxs
    Jan 27, 2022 at 17:02
  • tasker or macrodroid
    – alecxs
    Jan 27, 2022 at 17:03


You must log in to answer this question.

Browse other questions tagged .