-1

I'm working in Cordova project and there I like to run my project using the command

Cordova run android

in command prompt window. And I have also enabled developer option and USB debugging option in mobile and connected the mobile through USB.

Now on running the command, I get the issue that


Checking Java JDK and Android SDK versions ANDROID_SDK_ROOT=undefined (recommended setting) ANDROID_HOME=C:\Users\Tommy\AppData\Local\Android\Sdk (DEPRECATED) adb: Command failed with exit code ENOENT Error output: 'adb' is not recognized as an internal or external command, operable program or batch file.

I set the path for ANDROID_HOME as C:\Users\Tommy\AppData\Local\Android\Sdk\platform-tools

And opened a new command prompt window and ran the command again but also I was unable to get this right.

Can anyone help me with a solution? Thanks in advance..!

Community
  • 1
  • 1
Javith J
  • 77
  • 2
  • 9

1 Answers1

0

You need to add the platform-tools directory to the executable PATH environment variable. I added a screenshot below as an example:

enter image description here

Or set using powershell:

C:\Users\Tommy>powershell
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\Tommy> [Environment]::SetEnvironmentVariable("ANDROID_HOME", "C:\Users\Tommy\AppData\Local\Android\sdk", "User")
PS C:\Users\Tommy> [Environment]::SetEnvironmentVariable("ANDROID_TOOLS", [Environment]::GetEnvironmentVariable("ANDROID_HOME", "User") + "\tools", "User")
PS C:\Users\Tommy> [Environment]::SetEnvironmentVariable("ANDROID_PLATFORM_TOOLS", [Environment]::GetEnvironmentVariable("ANDROID_HOME", "User") + "\platform-tools", "User")
PS C:\Users\Tommy> [Environment]::SetEnvironmentVariable("PATH", [Environment]::GetEnvironmentVariable("PATH", "User") + ";"  + [Environment]::GetEnvironmentVariable("ANDROID_TOOLS", "User") + ";" + [Environment]::GetEnvironmentVariable("ANDROID_PLATFORM_TOOLS", "User"), "User")
rolling_codes
  • 15,174
  • 22
  • 76
  • 112