Repository navigation
Add a doctor validator warning for multiple adb installations #9709
Description
Just helped track down an issue an internal customer was having whereby multiple adb instances were fighting each other:
/usr/bin/adbexisted as part of theadbDebian package that was installed on the user's system. It seemed to be restarting its server automatically when killed because of an entry ininit.d$ANDROID_HOME/platform-tools/adbwas the user's preferredadbinstance and was also the instance detected by flutter tools since it lived in a proper SDK folder structure.
There was initially an issue whereby one adb client process would detect a mismatch between the client and server versions and restart the appropriate server, and in so doing, it'd echo a message to the terminal that flutter tools mistook for a device line (fixed in #9693).
Once that issue was fixed, the two adb servers still seemed to be fighting each other, causing the preferred adb to show no connected devices even though there were devices connected. The solution we eventually found for this was uninstalling /usr/bin/adb (via sudo apt-get remove adb)...
This experience, along with reports within the Flutter team of multiple adb instances not playing nicely with each other and with Flutter tools, means we probably want to add a doctor validator that will warn the user if multiple adb binaries are detected.
Activity
amoghe commentedon Sep 5, 2017
👍
Experience report
I ran into a similar situation myself. In my case
android-tools-adb(the debian pkg that brings in/usr/bin/adb) did not add an init script, however since I was using it to force the adb connection over tcp it wasn't clear to me whichadbflutter was preferring to use (resulting the in the client/server mismatch message)This bug got me thinking in the right direction and I was finally able to run the adb using the the adb that is present in the
platform-toolsdir of the android sdk installation (runningdoctorwith the-voption showed which adb flutter preferred to use)Hope this experience report helps you craft the appropriate warning message to emit in the output of a
doctorinvocation.Hixie commentedon Dec 18, 2017
@tvolkert What did you have in mind here? Comparing
which adbto theadbthat we know about and seeing if they are different?tvolkert commentedon Dec 18, 2017
Yeah that'd be one signal.
Also, just warning if there exists a
/usr/bin/adbat all since it'll never be what we detect as the Android SDK location.christopherfujino commentedon Jan 14, 2020
Related to #6514
3 remaining items
fluttter doctorshould check for incompatible adb in path #6514 as a duplicate of this issue[flutter_tools] Add doctor validator warning for multiple adb install…
[flutter_tools] Add doctor validator warning for multiple adb install…
github-actions commentedon Jul 14, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.