adb is not recognized as internal or external command on windows
Asked Answered
G

5

56

I set the c:/android-sdk/tools path to the path environment and commands like emulator is working just fine. But the adb command is still not recognized, what should I do ?

In the path system variable I added the android-sdk path and the tools path so far. Is there something else that needs to be done? Because commands like adb devices do not work. It says that the command is not recognized. By the way I want to do adb install comeapp.apk.

Gershwin answered 5/1, 2012 at 15:11 Comment(1)
Is the adb right in place? It moved to C:\Program Files\android-sdk-windows\platform-tools\adb.exe while agoDru
R
93

If you go to your android-sdk/tools folder I think you'll find a message :

The adb tool has moved to platform-tools/

If you don't see this directory in your SDK, launch the SDK and AVD Manager (execute the android tool) and install "Android SDK Platform-tools"

Please also update your PATH environment variable to include the platform-tools/ directory, so you can execute adb from any location.

So you should also add C:/android-sdk/platform-tools to you environment path. Also after you modify the PATH variable make sure that you start a new CommandPrompt window.

Rosinski answered 5/1, 2012 at 15:23 Comment(3)
isn't it C:\android-sdk\platform-tools in windows ?Habited
With newest version of android studio path is as follows: C:\Users[youruser]\AppData\Local\Android\android-studio\sdk\platform-toolsHeindrick
Just add the platform-tools as an entry on your PATH variable and reboot Android Studio and it will work just fineObeah
S
14

If you get your adb from Android Studio (which most will nowadays since Android is deprecated on Eclipse), your adb program will most likely be located here:

%USERPROFILE%\AppData\Local\Android\sdk\platform-tools

Where %USERPROFILE% represents something like C:\Users\yourName.

If you go into your computer's environmental variables and add %USERPROFILE%\AppData\Local\Android\sdk\platform-tools to the PATH (just copy-paste that line, even with the % --- it will work fine, at least on Windows, you don't need to hardcode your username) then it should work now. Open a new command prompt and type adb to check.

Spermato answered 25/8, 2017 at 15:38 Comment(2)
Thank you! This was the only thing that worked for me, it needed the path to have the new env variable. To add: I also had to restart Android Studio for it to take affect and work in the Android Studio Terminal.Excommunicatory
OMG! Thank you for being so specific on the pathHarte
G
12

You have two ways:

First go to the particular path of Android SDK:

1) Open your command prompt and traverse to the platform-tools directory through it such as

$ cd Frameworks\Android-Sdk\platform-tools

2) Run your adb commands now such as to know that your adb is working properly :

$ adb devices OR adb logcat OR simply adb

Second way is :

1) Right click on your My Computer.

2) Open Environment variables.

3) Add new variable to your System PATH variable(Add if not exist otherwise no need to add new variable if already exist).

4) Add path of platform-tools directory to as value of this variable such as C:\Program Files\android-sdk\platform-tools.

5) Restart your computer once.

6) Now run the above adb commands such adb devices or other adb commands from anywhere in command prompt.

Also on you can fire a command on terminal setx PATH "%PATH%;C:\Program Files\android-sdk\platform-tools"

Germinal answered 11/1, 2016 at 17:31 Comment(1)
Change the first way 2nd step to: $ ./adb devices OR ./adb logcat OR simply ./adbMerc
B
1

I hope this is still relevant:

To run an adb command on Windows we will need to add the platform-tools path into system environment variables.

"C:\Users\User\AppData\Local\Android\Sdk\platform-tools"

AppData directory is hidden generally so enable show hidden files.

Once you get the path, add it to the system environment variables & restart the cmd, you'll get the adb commands running.

Thank you.

Bine answered 16/5, 2023 at 14:12 Comment(0)
V
0

For me, I just added the below path to my system environment variables

C:\Users\[YOUR-USERNAME]\AppData\Local\Android\Sdk\platform-tools

You can now use the adb command.

Vilhelmina answered 25/12, 2023 at 9:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.