I tried to run an ADB command in the Android Studio terminal. However I got the following error:
adb is not recognized as an internal or external command
First I turned on ADB integration under Tools > Android
menu. Then I tried adding the platform-tools
folder to a Path
variable under Settings > Appearance & Behavior > Path Variables
to no success. (I restarted AS after the change as you would a shell.)
I know an easy fix would be to change my OS path variable, but I would like to avoid doing that. So the question becomes: is there any way to get Android Studio to recognize the command in it's terminal via the settings?
Note and opinion: This happens out of a fresh install of 3.0.1. It seems a little silly to me if the software installs the SDK & tools that it would not have the commands working out of the box in the terminal.
Enable adb debugging on your device To make it visible, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options at the bottom. On some devices, the Developer options screen might be located or named differently. You can now connect your device with USB.
So, all one needs to do is to open Android Studio, click on File>Settings. In the next window, under Tools, click on Terminal. Then enter the complete location to adb in the Start Directory. Restart Android Studio and your adb command should execute now.
on windows:
If you have installed the software in its default folder, please follow the instructions below:
type:
cd C:\Users\<YOUR PC USER NAME>\AppData\Local\Android\Sdk\platform-tools
YOUR PC USER NAME - is your pc user name (without <> )
after that, please connect device and try adb by typing:
adb devices
The adb tool is located at
C:\Users\<YOUR PC USER NAME>\AppData\Local\Android\Sdk\platform-tools
On a windows system to access adb from anywhere (android studio,vscode,cmd etc) you need to add this path to the environment variable of your system. for this
reopen the application (android studio/cmd/vscode) where you want to access adb, and try typing adb in the cmd ,you will have access to all the adb features.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With