Android 'adb' 不是内部或外部命令,也不是可运行的程序或批处理文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20564514/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
'adb' is not recognized as an internal or external command, operable program or batch file
提问by Nibha Jain
I am trying to run google map v2 on emulator, I am following thistutorial. When I was trying to install required apk file on emulator, I am getting below error.
我正在尝试在模拟器上运行 google map v2,我正在关注本教程。当我尝试在模拟器上安装所需的 apk 文件时,出现以下错误。
I tried to solve this using thistutorial.Followed all steps, added the path to paltform-tools to environment path. Also after modifying the PATH variable started a new CommandPrompt window.
我尝试使用本教程解决此问题。按照所有步骤,将 paltform-tools 的路径添加到环境路径。同样在修改 PATH 变量后启动了一个新的 CommandPrompt 窗口。
But getting the same error. I need to check my google map application on emulator. Kindly suggest me.
但得到同样的错误。我需要在模拟器上检查我的谷歌地图应用程序。请建议我。
'adb' is not recognized as an internal or external command,
operable program or batch file.
回答by Jatin Malwal
Set the path of adb into System Variables. You can find adb in "ADT Bundle/sdk/platform-tools" Set the path and restart the cmd n then try again.
将 adb 的路径设置为系统变量。可以在“ ADT Bundle/sdk/platform-tools”中找到 adb设置路径,重启cmd n 再试。
Or
或者
You can also goto the dir where adb.exe is located and do the same thing if you don't wanna set the PATH.
如果您不想设置 PATH,您也可以转到 adb.exe 所在的目录并执行相同的操作。
If you wanna see all the paths, just do
如果你想看到所有的路径,就做
echo %PATH%
回答by Chris Sim
If you want to use it every time add the path of adb to your system variables: enter to cmd (command prompt) and write the following:
如果你想每次都使用它,将 adb 的路径添加到系统变量中:输入 cmd(命令提示符)并写入以下内容:
echo %PATH%
this command will show you what it was before you will add adb path
此命令将在您添加 adb 路径之前向您显示它是什么
setx PATH "%PATH%;C:\Program Files\android-sdk-windows\platform-tools"
be careful the path that you want to add if it contains double quote
如果要添加的路径包含双引号,请小心
after you restart your cmd rewrite:
重新启动 cmd 后重写:
echo %PATH%
you will find that the path is added
你会发现添加了路径
PS: if you just want to add the path to cmd just to this session you can use:
PS:如果您只想将 cmd 的路径添加到此会话中,您可以使用:
set PATH=%PATH%;C:\Program Files\android-sdk-windows\platform-tools
回答by Vamsi Tallapudi
From Android Studio 1.3, the ADB location is at:
从 Android Studio 1.3 开始,ADB 位置位于:
C:\Users\USERNAME\AppData\Local\Android\sdk\platform-tools.
Now add this location to the end of PATH of environment variables. Eg:
现在将此位置添加到环境变量 PATH 的末尾。例如:
;C:\Users\USERNAME\AppData\Local\Android\sdk\platform-tools
回答by ban-geoengineering
I did this on Windows 7, by going to:
我在 Windows 7 上这样做了,方法是:
Start> Control Panel> System> Advanced System Settings> Environment Variables...
开始>控制面板>系统>高级系统设置>环境变量...
In this Environment Variableswindow, in the User variables for (your-username)highlight Path
and click Edit...
在此环境变量窗口中,在(您的用户名)的用户变量中突出显示Path
并单击编辑...
You then need to append a ;
if there isn't already one at the end of the Variable valuefield, and then append C:\Users\<your-username>\AppData\Local\Android\sdk\platform-tools;
to that same field.
;
如果Variable value字段的末尾还没有一个,则需要附加一个,然后附加C:\Users\<your-username>\AppData\Local\Android\sdk\platform-tools;
到同一字段。
Then click the three OK buttons to get out.
然后单击三个确定按钮退出。
If you already have a Command Promptwindow open, close it then re-open and the adb devices
command should then work.
如果您已经打开了命令提示符窗口,请将其关闭然后重新打开,然后该adb devices
命令应该可以工作。
回答by Vaibhav Agarwal
Follow path of you platform tools folder in android setup folder where you will found adb.exe
按照 android setup 文件夹中平台工具文件夹的路径,您将在其中找到 adb.exe
D:\Software\Android\Android\android-sdk\platform-tools
D:\Software\Android\Android\android-sdk\platform-tools
Check the screenshot for details
查看屏幕截图了解详情
回答by m9m9m
In Windows 10,
在 Windows 10 中,
- Add User Variable PATH:
%USERPROFILE%\AppData\Local\Android\sdk\platform-tools
. - Restart
cmd
(if any open). adb devices
, it should list, if it does, you are all set.
- 添加用户变量路径:
%USERPROFILE%\AppData\Local\Android\sdk\platform-tools
. - 重新启动
cmd
(如果有的话)。 adb devices
,它应该列出,如果是,你就已经准备好了。
That's it!
就是这样!
回答by gauravbhai daxini
回答by Amit Ray
adb command can be under the new path below- C:\Users\USERNAME\AppData\Local\Android\sdk\platform-toolsfor new versions of Android studio. I found in this location for me.
adb 命令可以在下面的新路径下 - C:\Users\USERNAME\AppData\Local\Android\sdk\platform-tools用于新版本的 Android Studio。我在这个位置为我找到了。
回答by Williaan Lopes
If your OS is Windows, then it is very simple. When you install Android Studio, adb.exe is located in the following folder:
如果您的操作系统是 Windows,那么这很简单。安装 Android Studio 时,adb.exe 位于以下文件夹中:
C:\Users\**your-user-name**\AppData\Local\Android\Sdk\platform-tools
Copy the path and paste in your environment variables.
复制路径并粘贴到您的环境变量中。
Open your terminal and type: adb
it's done!
打开你的终端并输入:adb
完成了!
回答by Pullat Junaid
just open Android studio and press "Tools" on Top navigation bar
只需打开 Android Studio 并按顶部导航栏上的“工具”
tools->SDK Manager
Where you can get SDK location
在哪里可以获得 SDK 位置
Open SDK folder -> platform-tools
打开 SDK folder -> platform-tools