2

I would like to run the following command in my Terminal of Android Studio.:

adb kill-server
adb start-server

I am getting the issue:

Command not found. 

I have already read that I have to add the path somehow. But I do not understand how it should be done...

I am running Android Studio 2.2 on Windows 10 Pro.

Community
  • 1
  • 1
jublikon
  • 3,427
  • 10
  • 44
  • 82
  • Add the path in your **Environment Variables**. The link you are referring is for Linux systems and not Windows. – Prerak Sola Jun 02 '16 at 08:46
  • I looked up the Android SDK path in Android Studio >> Settings >> Appearance & Behavior >> System Settings >> Android SDK and added it to the Windows variable Path. Restarted Andriod Studio but still getting the same issue. Is the path correct? C:\Users\jublikon\AppData\Local\Android\Sdk – jublikon Jun 02 '16 at 08:54
  • 2
    You mentioned you have add SDK path into the Windows variable Path, but the adb command is under SDK\platform-tools, have you add this directory and restart ? – L. Swifter Jun 02 '16 at 08:57
  • An installer that does not define its environment variables is a perfunctory and lukewarm installer. This is clearly a bug in the installer of the Android Studio "complex" – carl Dec 05 '16 at 08:04

4 Answers4

3

Create a system variable: enter image description here

Add it to Path: enter image description here

Adb is located under platform-tools: enter image description here

yushulx
  • 11,695
  • 8
  • 37
  • 64
1

If you are using mac or linux, you can try like this

export ANDROID_HOME=/Users/$(whoami)/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools

Now Check

adb status
Farid Haq
  • 3,728
  • 1
  • 21
  • 15
1

If you don't want to modify your system environment and instead keep the changes local to Android Studio, do this:

  1. Goto Settings -> Tools -> Terminal

  2. Add ANDROID_SDK_ROOT=C:\Users\<your username>\AppData\Local\Android\Sdk to "Environment variables". Separate multiple variables with semicolon (;) or use the GUI tool (Shift+Enter). Modify the path to point to your SDK installation as needed.

  3. Change "Shell path" to C:\Windows\System32\cmd.exe /k "set "PATH=%ANDROID_SDK_ROOT%\platform-tools;%PATH%" "

Notes:

  • ANDROID_SDK_ROOT is used for the installation directory of the SDK according to the documentation.
Niklas Holm
  • 949
  • 9
  • 14
0

if you are still getting same error,simply go to your sdk location in terminal and type cd platform-tools .Then start doing what you want to do.adb works here. :)