5

Multiple times per day, ADB suddenly stops responding. After this occurs, every adb shell command fails to finish or produce any output. IntelliJ and Android Studio no longer recognize my phone(s).

The solution is straightforward: run the command

killall adb

However, I find myself needing to do this repeatedly, approximately every 15-30 minutes, which significantly hampers my development workflow. Each time I perform this action, I have to restart my Flutter application. Do you have any suggestions for resolving this issue?

I am using a New M2 MacBook Pro with Ventura 13.6, and ADB was installed via the Jetbrains SDK Manager (SDK Platform-Tools):

enter image description here

6
  • Also posted on Apple.SE: apple.stackexchange.com/q/465177/95704
    – Andrew T.
    Commented Oct 19, 2023 at 14:56
  • I do have the same problem. Last weeks it just helped to run adb kill-server. But since days even this call times out and nothing happens until i kill all adb services. Do you use any "bad" security tools such as Zscaler, Cyberark, ...?
    – Timo Bähr
    Commented Nov 6, 2023 at 20:08
  • @TimoBähr It is a company PC so some security tools are installed, for example SentinelOne and Netskope.
    – L.Nightman
    Commented Nov 6, 2023 at 22:10
  • Do you have any other Android devices connected, or Android emulators running? Commented Nov 8, 2023 at 20:26
  • @L.Nightman I'm running in the same issue, and it started once my client switched to Netskope VPN. Did you find any workaround ?
    – FDuhen
    Commented Nov 7 at 9:19

2 Answers 2

0

I have never used adb on macOS, but I had similar problems with it on Linux, and cured them by starting adb manually with sudo.

Kill any existing server demon with:

sudo adb kill-server

Then start it with

sudo adb start-server

Then see how things go from there.

6
  • 1
    I can not execute this command because it will never finish, just like all other adb commands. If I use killall adb to terminate adb. Then I am able to execute those commands, but it does not prevent adb from getting stuck sometime later.
    – L.Nightman
    Commented Nov 6, 2023 at 22:07
  • @L.Nightman Same issue any solution you found?
    – Arul
    Commented Jun 21 at 6:38
  • 1
    @Arul It has been a while since I did Android development, but if I remember correctly there was no real solution to this problem. Maybe disabling company security tools will help, but that is usually not an option.
    – L.Nightman
    Commented Jun 25 at 8:05
  • Same here, only restarting the system solves that issue. I suspect of Some other programs using the host of adb.
    – Arul
    Commented Jun 25 at 15:07
  • 1
    An idea: adb uses TCP port 5037. Maybe one of your corporate security tools is trying to use that port too? You can change the port it uses with the -P and -L options, but I don't know how to pick a sensible port to try. Asking corporate support people which ports their software uses is unlikely to get you anywhere. Commented Jun 25 at 17:12
0

try

lsof -i <port>
kill -9 pid (of adb Listen port)
1
  • I have no real way of testing this, because I stopped developing Android, but it seems like this is just a different way of executing "killall adb". It will probably have the same effect: Fix the problem, but require a lengthy restart of my application and it won't prevent it from happening again ~30 min later.
    – L.Nightman
    Commented Nov 7 at 15:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .