Unstable adb wireless debugging

825 Views Asked by At

I am trying to use wireless debugging on my Samsung S10e and it works sometimes. For some reason, it looks like it keeps disconnecting and connecting again frequently. Sometimes, it stays disconnected. I then have to go to developer settings and switch wireless debugging off and on. Often, it happens when I try to launch the app, and in effect, it fails.

Example log output:

Launching lib/main.dart on SM G970F in debug mode...
Running Gradle task 'assembleDebug'...
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app-debug.apk...
Error: ADB exited with exit code 1
adb: device offline
Error launching application on SM G970F.
Launching lib/main.dart on SM G970F in debug mode...
Running Gradle task 'assembleDebug'...
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app-debug.apk...
Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install /Users/gustek/my-github/liveness_mlkit/build/app/outputs/flutter-apk/app-debug.apk:
Error launching application on SM G970F.

Sometimes, the error is different. Often, another error I see is "failed uninstalling previous version." I am not sure if that one is related, I delete the app manually in these cases.

I think it may be something with the phone. Or maybe router settings making the connection unreliable? The most notable indication of the issue is that my phone keeps vibrating with the. "wireless debugging connected" notification that I can see is going away and coming back almost instantly very frequently.

Any ideas, or suggestions on what may be the cause?

The phone is: Samsung S10e, Android 12

ADB version:

Android Debug Bridge version 1.0.41
Version 33.0.3-8952118

I don't remember now, but I believe adb is managed by Android Studio

Android Studio Flamingo | 2022.2.1 Patch 2
Build #AI-222.4459.24.2221.10121639, built on May 12, 2023
Runtime version: 17.0.6+0-17.0.6b802.4-9586694 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
1

There are 1 best solutions below

0
First voyager On
  1. Check phone settings: Ensure stable Wi-Fi connection, configure Wi-Fi sleep settings properly, and check battery optimization settings to avoid interference with wireless debugging.

  2. Verify router settings: Connect both phone and debugging device to the same Wi-Fi network. Restart the router or temporarily disable firewall/network filtering features that may cause instability.

  3. Address error messages: Uninstall the app manually when encountering the "failed uninstalling previous version" error before reinstalling. Focus on resolving the wireless debugging connectivity problem first.

  4. Check ADB version: You have a recent version, typically managed by Android Studio. Update Android Studio to the latest version to ensure compatibility.

  5. Further troubleshooting: Try wireless debugging with a different device to isolate the problem to Samsung S10e. Analyze Android logcat output for any relevant error messages or warnings related to the connection.