Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio terminal: adb is not recognized as an internal or external command

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.

like image 919
Matthew Cordaro Avatar asked Feb 12 '18 17:02

Matthew Cordaro


People also ask

How do I enable ADB in 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.

Is not recognized as an internal or external command Android studio?

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.


2 Answers

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
like image 100
Guy4444 Avatar answered Sep 27 '22 20:09

Guy4444


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

  1. search environment variables
  2. go to user variables section and edit path
  3. add new path under key PATH and paste the above path

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.

like image 20
Mahesh Jamdade Avatar answered Sep 27 '22 19:09

Mahesh Jamdade