Could not automatically detect an ADB binary - And

2020-02-13 07:55发布

问题:

I tried testing my app on Android Studio but I was getting stuck at

"waiting for AVD to come online..."  

I've read resetting adb from Android Device Monitor will do it, and it did...
for 1 test, when I've restarted my PC the next day I'm getting not only:

"waiting for AVD to come online..." 

but also

"Could not automatically detect an ADB binary." error every time I try testing my app.

Maybe worth mentioning when I did that 1 test, I was also getting the

"Could not automatically detect an ADB binary." 

error, but at least it worked.

回答1:

From my experience this is because the AVD can't detect your ADB binary. When you launch the AVD if you go into settings, it's the '...' symbol on the toolbar of the virtual machine, then go to the 'Settings' section there should be an option called 'Use detected ADB location' switch this off then select the location of your adb binary. In Linux you can do this by typing the command:

which adb

Select the location shown in the settings. Once you've done that the error should stop appearing.



回答2:

This error because android studio did not find adb.exe in SDK\platform-tools folder. Maybe this is caused by sdkmanager while trying to update current packages.

Any way, the easiest way to fix this error is by downloading SDK Platform Tools as zip file from https://developer.android.com/studio/releases/platform-tools.html , unzip it and replace the current platform-tools folder in SDK folder.



回答3:

go to ..\AppData\Local\Android\Sdk\platform-tools and reinstall your ADB, i guess this happens on ADB 32 in an system 64bits



标签: android adb avd