gpt4 book ai didi

android-studio - Android Studio 终端 : adb is not recognized as an internal or external command

转载 作者:行者123 更新时间:2023-12-03 16:21:43 25 4
gpt4 key购买 nike

我尝试在 Android Studio 终端中运行 ADB 命令。但是我收到以下错误:

adb is not recognized as an internal or external command



首先,我在 Tools > Android 菜单下打开了 ADB 集成。然后我尝试将 platform-tools 文件夹添加到 Path 下的 Settings > Appearance & Behavior > Path Variables 变量中,但没有成功。 (我在更改后重新启动了 AS,就像在 shell 中一样。)

我知道一个简单的解决方法是更改​​我的操作系统路径变量,但我想避免这样做。 所以问题变成了:有没有办法让Android Studio通过设置识别终端中的命令?

注意和意见:这是在全新安装 3.0.1 时发生的。如果该软件安装了 SDK 和工具,那么它不会在终端中运行开箱即用的命令,这对我来说似乎有点傻。

最佳答案

选项1

• 创建一个新文件,复制粘贴以下两行:

PATH %PATH%;C:\Users\Example\AppData\Local\Android\Sdk\platform-tools
cmd /k "cls"

The path to the adb.exe is just an example. You have to find the correct path first, and use that instead of C:\Users\Example\AppData\Local\Android\Sdk\platform-tools.



• 以 .bat 扩展名保存文件,例如 cmdWithAutoUpdatedTempPath.bat
• 将文件移动到您想要的位置,例如 C:\Users\Example\AppData\Local\Android
•在Android Studio中,去 FileSettings...ToolsTerminal并设置 Shell pathC:\Users\Example\AppData\Local\Android\cmdWithAutoUpdatedTempPath.bat

The name of the file and the path to it is just an example. You have to use the values from the previous two steps, instead of C:\Users\Example\AppData\Local\Android\cmdWithAutoUpdatedTempPath.bat.



选项 2

在 Android Studio 中,转到 FileSettings...ToolsTerminal 并将 0x21818122 设置为 0x2518122313134313431343134313431343431343134313431343134313431343134313433431343431343434313434343434343434343。

The path to the adb.exe is just an example. You have to find the correct path first, and use that instead of C:\Users\Example\AppData\Local\Android\Sdk\platform-tools.



选项 3

每次创建新 session 时,在终端中使用此命令更新路径变量: Start directory

The path to the adb.exe is just an example. You have to find the correct path first, and use that instead of C:\Users\Example\AppData\Local\Android\Sdk\platform-tools.

关于android-studio - Android Studio 终端 : adb is not recognized as an internal or external command,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48751976/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com