Android Studio Wireless Debugging Goes On and Off
Asked Answered
A

2

16

I can get wireless debugging to work in Android Studio. It just doesn't work consistently. It is often a hassle to get it to connect at all, but I can usually get around it using a variety of methods, some of which are:

  • Pair using adb in a command prompt
  • Disconnect adb (AS will reconnect)
  • Restart the phone

When it gets unpaired, pairing in AS seldom works. It just waits a long time and then says it failed, no explantation. However, pairing in a command prompt almost always works, so I can get it paired.

When I do get it to connect, it often keeps dropping out. Sometimes even while running my app and generating logcat output.

Sometimes wireless debugging gets turned off on the phone. Sometimes not, but the notification disappears. Or not.

My wifi works just fine and is pretty reliable. I do not think it is the wifi. However, it is a dual band router. Where I work, it is usually using the 2.5 GHz band. I have not found anything on the Internet mentioning dual band.

The phone is an S22 Ultra and works well most of the time. I also do not think it is the phone.

Dual band is pretty common these days. Do other people have trouble with dual band. Is it supposed to work with dual band? Are there any other suggestions.

Accordance answered 20/2, 2023 at 16:14 Comment(0)
L
5

I fixed that issue using following method:

First I connected my device using wifi debugging.

Just after the device is connected, I open terminal from android studio and cd to somepath/Android/Sdk/platform-tools

After that, I write following commands:

  • ./adb tcpip 5555
  • ./adb connect x.x.x.x:5555

In the above command, replace x.x.x.x with the IP address of your Android device which can be found in the Wireless debugging menu.

Note that initially android studio will have 2 connections, but eventually the first connection will disconnect, and debugging will work only on 5555 port.

You might need to perform this activity each day when you open your android studio.

Listlessness answered 20/4, 2023 at 6:7 Comment(1)
didnt work for meLuedtke
A
0

Had the same issue, got it fixed. By changing Settings>Wi-Fi>Wi-Fi Network > IP settings> DHCP to Static. > in IP Address > Enter a fixed IP Address.

After doing the above, the wi-fi device is stable in the list.

Possibly, the ip address is dynamic. Therefore, whenever the Mobile's IP address changes in the network. "Wireless debugging connected" notification pops up. The Device doesn't appear in the run list.

Add answered 21/9, 2023 at 14:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.