jublikon
jublikon

Reputation: 3447

Android Studio Terminal: Command not found

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.

Upvotes: 2

Views: 6082

Answers (4)

Niklas Holm
Niklas Holm

Reputation: 1028

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.

Upvotes: 1

Farid Haq
Farid Haq

Reputation: 4209

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

Upvotes: 1

user6088902
user6088902

Reputation:

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. :)

Upvotes: 0

yushulx
yushulx

Reputation: 12160

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

Upvotes: 3

Related Questions