12

I am following a Wiki on how to install and set up Android SDK and I am stuck at a step where I am supposed to test if the ADB server works by using the command adb start-server. Is this command correct?

The Wiki can be found here: http://wiki.rootzwiki.com/Android_SDK

I have done what it says in step 5. But it doesn't seem to work. I get the standard message in CMD that the command is not an internal, external command or a program.

Add the following to the end of the Variable value field:

Windows XP: ;C:\Program Files\Android\android-sdk\tools\;C:\Program Files\Android\android-sdk\platform-tools\

Windows Vista and later: Replace YOURUSERNAME in the following lines with your Windows username

32-Bit: ;C:\Program Files\Android\android-sdk\tools\;C:\Program Files\Android\android-sdk\platform-tools\

64-Bit: ;C:\Users\YOURUSERNAME\AppData\Local\Android\android-sdk\tools\;C:\Users\YOURUSERNAME\AppData\Local\Android\android-sdk\platform-tools\

Click OK, OK, and OK to close the Advanced settings.

So what gives? The CMD prompt is at C:\Users\myusername when I run the command. Maybe I need to CD to the android-sdk folder first before running the command? But then what use is it to add the path in the PATH variable?...

3
  • 1
    After you add variables to the system you need to close the command window and open a new one. if that still doesnt seem to allow you to do adb commands, make sure the path you are adding is the path that you actually installed the SDK to. Commented Jan 24, 2013 at 21:47
  • The reason to add the path into the $PATH variable, which btw, is system-wide, so no matter where you are in the command line i.e. CMD, adb will work regardless as windows knows where the actual adb binary resides in.
    – t0mm13b
    Commented Jan 24, 2013 at 21:51
  • Yes, but I don't get this part where you're supposed to replace YOURUSERNAME with the actual user name of the account. I used default installation location on C drive and I installed it on a 64-bit system.
    – Samir
    Commented Jan 24, 2013 at 22:02

5 Answers 5

18

I have solved my own problem. Those search paths are all messed up!

I checked the installation path and it's installed in C:\Program Files (x86)\Android even though I do have a 64-bit version of Windows. But nevertheless, this is the default installation location.

So I updated the PATH variable with following line.

C:\Program Files (x86)\Android\android-sdk\tools\;C:\Program Files (x86)\Android\android-sdk\platform-tools\

And now I can start ADB server from CMD regardless of where the prompt is at.

Android SDK ADB server in CMD screen

I have no clue why they are referring to AppData\Local\ folder in the guide for the 64-bit systems. That makes no sense at all. If anywhere, the installation location should be in "Program Files" folder for a 64-bit system. They actually put this in for the 32-bit systems... like I said, it's all messed up.

I should point out that adb.exe has been moved from C:\Program Files (x86)\Android\android-sdk\tools\ to the new location C:\Program Files (x86)\Android\android-sdk\platform-tools\. This has been done in later versions of Android SDK.

So if you are reading this in year 2013 then you can probably just get the latest SDK and use only this last search path. You don't need them both. At least not for ADB and Fastboot. If you're a developer then you maybe need to access tools from both directories, although if you're a dev then you probably won't need to read this at all.

How to edit a system variable

Here's a short how-to for the newbies. What you need is the Environment Variables dialog.

  1. Click Start (Orb) menu button.
  2. Right click on Computer icon.
  3. Click on Properties. This will bring up System window in Control Panel.
  4. Click on Advanced System Settings on the left. This will bring up the System Properties window with Advanced tab selected.
  5. Click on Environment Variables button on the bottom of the dialog. This brings up the Environment Variables dialog.
  6. In the System Variables section, scroll down till you see Path.
  7. Click on Path to select it, then the Edit button. This will bring up the Edit System Variable dialog.
  8. While the Variable value field is selected, press the End key on your keyboard to go to the right end of the line, or use the arrow keys to move the marker to the end.
  9. Type in ;C:\Program Files (x86)\Android\android-sdk\tools\;C:\Program Files (x86)\Android\android-sdk\platform-tools\ and click OK.
  10. Click OK again, then OK once more to save and exit out of the dialogs.

That's it! You can now start any Android SDK tool, e.g. ADB or Fastboot, regardless of what your current directory is in CMD. For good measure here's what the dialog looks like. This is where you edit the Path variable.

environment variables

4
  • 2
    The location where binaries on Windows are stored is determined by the type of the binary and not by the running Windows version. That is, a 32-bit binary will be installed in Program Files (x86) and a 64-bit binary will go to Program Files. Therefore the SDK installer uses the correct location.
    – Flow
    Commented Jan 24, 2013 at 22:40
  • Good point! In other words the Android SDK is 32-bit so it installs to the 32-bit (x86) program folder. Which is why that part of the root guide that gives instructions for 64-bit systems makes even less sense then.
    – Samir
    Commented Jan 24, 2013 at 22:44
  • just note that step 8 is different in windows 10. thanks for your help!
    – STF
    Commented Sep 12, 2017 at 5:08
  • Hopefully, people looking to edit the PATH variable will know how to navigate dialog boxes and manipulate text strings.
    – Samir
    Commented Oct 20, 2017 at 20:48
4

I had platform-tools installed right from Android studio and that is where they were placed:

C:\Users\{USERNAME}\AppData\Local\Android\sdk\platform-tools

Then this is the directory needed for the PATH variable. AppData is usually a hidden folder and you will not see it in your directory unless you enable showing hidden directories.

1
  • Thanks Joshua – I've edited your answer accordingly to include those details (feel free to edit your posts anytime if you want to correct/improve), and removed the (now obsolete) comments.
    – Izzy
    Commented Nov 13, 2016 at 16:47
0

Just add this to System Variables "Path":

C:\Program Files (x86)\YOUR_ADT_FOLDER\sdk\platform-tools\

0

instead of looking for a default location simply look for platform-tools\ and android-sdk

or just sdk

those are the paths you need to add to the variable list

2
  • 1
    Yes, and where do I look for platform-tools and android-sdk? On my desktop?...
    – Samir
    Commented May 22, 2013 at 10:43
  • My point is that you have to look for them some place. Right? And what's a better place to start with than the default installation location? And just to be clear, we're not looking for any SDK folder that pops out! We're looking for the one used by the Android SDK. So I'm not gonna use file search to find any random folder called 'SDK' to put in my Path variable. Remember, you have Java SDK installed too if you have Android SDK (and probably others too if you're a developer). You don't want that SDK folder.
    – Samir
    Commented May 22, 2013 at 10:56
0

Steps to set the path to the platform tools:

Step1: Open Android Studio, go to Tools/SDK manager and get the Android SDK path which is:

C:\Users\username\AppData\Local\Android\sdk

Step2: Go to Control Panel/System/ Security/System and click on Advanced System Settings. Click on Environmental Variables. Click on PATH. Click Edit and append the following:

C:\Users\username\AppData\Local\Android\Sdk\platform-tools\;C:\Users\username\AppData\Local\Android\Sdk\tools\

Click Ok, OK.

Step3: To check if the paths are available, open the Command Prompt, type adb. Press Enter.

You should see a response that the platform-tools folder is in place.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .