- How to Fix Error “Unable to Locate ADB” on Android Studio?
- Restore ADB From Third-Party Antivirus
- Change Project Settings
- Install Android SDK from SDK Manager
- Reinstall Platform Tools
- Help, adb is not found!
- What’s the deal with adb?
- MacOS Configuration
- Windows Configuration
- Ошибка: не удалось найти adb в SDK в Android Studio
How to Fix Error “Unable to Locate ADB” on Android Studio?
Android Debug Bridge or ADB allows you to communicate with your devices via a command-line interface. It can be used for various purposes as it facilitates a bunch of actions including installing and debugging apps on your device. While trying to run your app via the Android Studio, you might face the “Unable to Locate ADB” error message that stops the simulation. As it turns out, the error message appears when Android Studio is not able to locate the ADB.exe file that is located in the platform-tools folder.
Unable to Locate ADB
This can happen due to several reasons including when your antivirus software removes the adb.exe file due to a false alarm. Issues like these are pretty common with antivirus software and thus, while using one, you need to make sure that it isn’t triggering a false positive on the files that you are working with. In addition to that, your project settings can also cause this error message to pop up. To understand and establish a better understanding of the error message in question, let us discuss the different reasons the issue may arise in more detail. However, do remember that the causes include but are not limited to the ones mentioned down below.
- Third-Party Antivirus — Antivirus softwares are known to cause several issues where they remove a file from your system due to a false positive. Avast antivirus has been known to cause this a lot with ADB where it locks the file in the virus chest. If this is applicable, you will have to restore the file from there and everything should be good. However, keep in mind that it may not only be limited to Avast if you are using a different third-party antivirus, but it could also likely be causing the issue and thus you should look at the files that have been quarantined by the application.
- Project Settings — As it turns out, in some cases, the error message may arise due to your project settings. The Android SDK by default does not give projects a default SDK. In such a scenario, you will have to go to the project settings and give the project an SDK which by default is set to No SDK.
- Corrupted Platform Tools — In addition to the aforementioned reasons, if your platform tools are damaged or corrupted, that might result in the error message as well. If this scenario is applicable, Windows Defender or any third-party software likely quarantines it, and as a result, you no longer have the adb.exe file in the platform-tools folder. In such a case, you will simply have to reinstall platform tools to resolve the issue.
Now that we have gone through the possible causes of the issue, let us get started by mentioning down the different workarounds that are available to you to get the issue sorted. So, without further ado, let us dive right into it.
Restore ADB From Third-Party Antivirus
As it turns out, the first thing that you should do when you face the error message in question is to check the third-party antivirus software that is installed on your system. More often than not, antivirus software can trigger false-positive and quarantine files that are not dangerous at all. In this case, the adb.exe would be the targeted file that is regarded as a dangerous or potential threat by the antivirus software and as a result removed from your system.
If this case applies to you, especially if you are using the Avast antivirus, you should check the virus chest of your antivirus software to see if the file has been quarantined by it. In case it is, simply restore the file and then try running the application. To do this, follow the instructions given down below:
- First of all, right-click your antivirus icon on the taskbar, and then from the menu that appears, choose Virus Chest.
Opening Virus Chest
- Here, check if the ABD.exe file is present. In case it is, go ahead and click the three horizontal dots in front of the file.
- From the drop-down menu that appears, choose the Restore option. This will remove the file from Virus Chest and you will be able to use it.
Restoring File from Virus Chest
- Alternatively, you can also choose the Restore and add exception option to make sure that it isn’t put away in the Virus Chest again.
Change Project Settings
If your antivirus software is not the culprit or if it doesn’t apply to you, the error message is likely being triggered due to your project settings. This happens when your project has no SDK assigned to it and as a result, it does not have access to ADB which is why you face the error message in question. To resolve this, you will have to change the default project settings which are set to No SDK by default. These settings can be found under Project Structure. To do this, follow the instructions given down below:
- First of all, make sure Android Studio is open.
- Then, make your way to File > Project Structure. Alternatively, you can click the Project Structure icon as shown in the picture down below.
- Once the Project Structure window is open, click on Project under Project Settings.
- Then, go ahead with what Project SDK is set to. If it is set to No SDK, go ahead and change it to Android API XX Platform from the drop-down menu.
Changing Default Project SDK
- In case there are no options in the drop-down menu, you can click the New button, choose Android SDK and then choose the directory where Android SDK is present.
- Once you have done that, you will be able to select Android API XX Platform from the drop-down menu.
- After you have done that, click the OK button and try running your application to see if the issue persists.
Install Android SDK from SDK Manager
As it turns out, if you are missing the relevant Android version SDK on your system, that will also cause the error message to arise. If this case is applicable, you can easily resolve the error message by installing the respective Android SDK from the SDK Manager found in the Android Studio. To do this, follow the instructions given down below:
- In the Android Studio window, open up the Preferences window by going to File > Settings.
- Then, on the left-hand side, make your way to Appearance & Behavior > System Settings > Android SDK.
SDK Manager
- Once you are in the SDK Manager, under SDK Platforms, install the SDK Platform for your respective Android version.
- After you have done that, go ahead and try running the application to see if you still face the error message.
Reinstall Platform Tools
Finally, if you are still facing the error message in question after trying the methods mentioned above, it could be that the issue is being triggered by damaged or corrupted platform tools files. If this scenario applies to you, you will have to reinstall the platform tools on your system to get rid of this error message. This can be done easily via the SDK Manager. You can uninstall platform tools via the SDK Manager and after that, you can easily install it again via a few clicks. To do this, follow the instructions given down below:
- First of all, close the Android Studio and then open up the Task Manager by right-clicking your taskbar. From the menu that appears, choose Task Manager.
Opening Task Manager
- In the Task Manager window, under Processes, look for the ADB.exe process and end it.
- Once you have done that, go ahead and open up the Android Studio again.
- Now, you will have to open up the SDK Manager. For this, click the box icon with a down arrow as shown in the picture.
Opening SDK Manager
- Once the SDK Manager is open, switch to the SDK Tools tab.
Switching to the SDK Tools Tab
- In the SDK Tools tab, scroll down until you see Android SDK Platform-Tools. Uncheck it and then click OK.
Android Platform-Tools in SDK Manager
- This will uninstall platform-tools from your IDE. Wait for it to finish uninstalling.
- Once it has been uninstalled and the Gradle is synced, open up the SDK Manager again and switch to the SDK Tools tab again. Here, look for Android SDK Platform-Tools again and tick it. Finally, click OK and wait for it to finish, and then sync your project.
- After all that is done, go ahead and try running your application to see if the error message pops up.
Источник
Help, adb is not found!
So you’ve downloaded Android Studio and installed the SDK. Eventually you may come across a tutorial telling you to type adb , maybe to enable debug mode in Firebase. That’s when it happens:
If your first instinct is to search for “how to install adb,” you’ll likely end up with some instructions about installing it in via your operating system’s package manager or downloading random zip files from phone customization websites. But this isn’t necessary! adb ships with the Android SDK installed by Android Studio, and with a couple of manual steps you can ensure that you’re always using the same up to date tools that your IDE is!
What’s the deal with adb?
adb stands for the “Android Debug Bridge,” which is a command line utility that is the debug multitool for Android. Typically it’s installed via Android Studio when you install the Android SDK under platform-tools , but it takes some amount of setup for your operating system to know to look there.
First open up Android Studio and navigate to “Tools > SDK Manager” from the menu.
Towards the top of the window, you can see the path where the IDE installed the Android SDK.
Now open up your terminal, type cd and paste in this path. This will work on Windows, MacOS, and Linux, but on Windows you may need to press shift+insert to paste into a terminal:
Next type cd platform-tools :
Then type ls (or dir on Windows). You should see adb or adb.exe depending on your operating system. From here you can type ./adb and see some program output.
You can run adb now, but I’ve never found a tutorial that starts with “copy your SDK path, cd into platform-tools, and type ./ before adb .” To get the experience many Android devs enjoy, you must update your PATH environment variable. This will be different on each operating system, and I’ll list out MacOS and Windows below. On Linux the steps can vary, but the MacOS instructions will work in some cases.
MacOS Configuration
MacOS (and Linux) users will typically use zsh or bash for their shell. To temporarily add the platform-tools directory to your PATH , type:
So in my example above, this becomes:
Now, whenever you type adb in this terminal window you can execute adb commands. But how do you get this to stick?
Since Android Studio tends to install the Android SDK in your user directory, you’ll want to edit the PATH for your user. And since it’s a command line utility, you’ll only need to update it for your terminal (as opposed to Mac GUI applications). To do this, you’ll want to edit the .profile file in your home directory (if this doesn’t exist, .bash_rc will achieve a similar result). This file will be hidden by default, so you may not see it Finder. Open this file in your favorite text editor:
and add this to the bottom:
Which, on my machine becomes:
Adding the extra define for ANDROID_SDK_ROOT is unnecessary, but it may help with some more complicated power user tools as well, such as the Cocos 2D command line utility.
With that, open a new terminal window and type adb . If you’ve done everything right, you’ll get a help page listing adb ‘s usage.
Windows Configuration
Windows is slightly different, and I’ll work entirely in Power Shell. Just like before, I can use the SDK manager to find my install location:
Источник
Ошибка: не удалось найти adb в SDK в Android Studio
Кто-нибудь знает что это значит? Я как бы чокнутый к Android. Когда я нажимаю кнопку «запустить» на симуляторе, я получаю это сообщение.
Throwable: невозможно найти adb в SDK
Я использую последнюю версию 0.8.14 .
РЕДАКТИРОВАТЬ: я использую Android Studio
ADB Теперь находятся в Android SDK Platform-инструментах .
- Проверьте свой [sdk directory]/platform-tools каталог и, если он не существует, откройте диспетчер SDK в Android Studio (кнопка где-то в верхнем меню, логотип Android со стрелкой вниз), перейдите на вкладку инструментов SDK и выберите / установите платформу Android SDK. -инструменты .
- Кроме того, вы можете попробовать автономный диспетчер SDK: откройте диспетчер SDK, и вы должны увидеть ссылку «Запустить автономный диспетчер SDK» где-то в нижней части окна настроек. Щелкните и откройте автономный диспетчер SDK, затем установите / обновите
«Инструменты> Инструменты платформы Android SDK».
Если вышеуказанное не решает проблему, попробуйте переустановить инструменты: откройте «Автономный диспетчер SDK» и удалите инструменты платформы Android SDK, полностью удалите [your sdk directory]/platform-tools каталог и установите его снова с помощью диспетчера SDK.
Источник