How to use android sdk tools setup

How To Set Android SDK Path In Windows And Mac

After you installed android studio, you still need to configure some android SDK environment variables then you can use it easily. This article will tell you how to correctly configure Android SDK environment variables such as ANDROID_HOME, PATH on Windows and macOS.

1. Configure Android SDK Variable In Windows.

1.1 Get Android SDK Install Directory Path.

Before you can configure it, you should first get the android SDK install directory follow below steps.

  1. Open android studio, click File -> Settings menu item in the top men bar.
  2. Expand Appearance & Behavior —>  System settings —> Android SDKmenu item on the left side of the popup window. Then you can find the Android SDK Location directory path on the right side (in this example, the Android SDK location path is C: \ Users \ Jerry \ AppData \ Local \ Android \ Sdk ), remember it.

1.2 Set% ANDROID_HOME% and% Path% system environment variable.

  1. Right-click the computer icon in Windows file explorer left side, click Properties menu item in the popup menu list. This will open the windows system configuration window.
  2. Click the Advanced system settings link on left panel, it will popup theSystem properties window, click the Environment variables button to openEnvironment variableswindow.
  3. Click the New ...button to add a new system variable, input ANDROID_HOME as the variable name, and input the Android SDK location directory path (such as C: \ Users \ Administrator \ AppData \ Local \ Android \ Sdk) as the variable value.
  4. Select variable Path and click Edit button and add ;% ANDROID_HOME% \ tools;% ANDROID_HOME% \ tools \ bin;% ANDROID_HOME% \ platform-tools at the end of its value. Please note the; must be English character otherwise it will not take effect.
  5. Click OK to close the system environment variables settings window, open a dos window, type command adb in it. If you see output like below that means the android SDK path variable has been configured successfully. C: \ Users \ Administrator> adb Android Debug Bridge version 1.0.39 Version 0.0.1-4500957 Installed as C: \ Users \ Administrator \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb .exe

2. Configure Android SDK Variable in macOS.

  1. Open Android Studio on macOS, then click Android Studio -> Preferences menu item at the left top toolbar.
  2. Input search keyword sdk in the search box of the popup Preferences dialog window left side.
  3. It will focus on the Android SDK menu item on the left side, and you can get the Android SDK Location directory path value on the right side Android SDK Location text box.
  4. Generally, the Android SDK is installed in the / Users / user-name / Library / Android / sdk folder on macOS.
  5. If you can not find the above folder in macOS finder or terminal, this is because the Library folder is a hidden folder by default, you should make the hidden folder visible by executing the command in a macOS terminal window (please read article How To Show Hidden Files In Mac OS Finder And Select Hidden Files In Html Upload File Form).
  6. You can also see the hidden Library folder by opening a macOS finder window, then click Go -> Go to Folder ... menu item, and input ~ / Library in the popup dialog input text box, then click Go button.
  7. This is also another method to show the hidden Library folder, open a macOS finder window, click Go -> Home menu item. Right-click the home folder, then click the Show View Options menu item in the popup menu list. Check the Show Library Folder checkbox.
  8. Use nano to create or edit user bash profile in user home directory. $ Nano .bash_profile.
  9. Add ANDROID_HOME other PATH environment variable in user bash profile.export ANDROID_HOME = / Users / Jerry / Library / Android / sdk export PATH = $ PATH: $ ANDROID_HOME / tools export PATH = $ PATH: $ ANDROID_HOME / tools / bin export PATH = $ PATH /: $ ANDROID_HOME / platform-tools
  10. Make the added system environment take effect. $ Source .bash_profile
  11. Now open a terminal and run adb, you should also see something output like in windows.

3. How To Download And Install Android SDK Command Line Tool Manually.

  1. If you do not need Android Studio, and you just want to use android SDK command-line tools only, it is very easy also.
  2. Go to the android SDK command-line tools download page and download related zip file.
  3. Unzip the zip file to a local folder for example C: \ android-sdk.
  4. Now when you start the Android Studio for the next time, it will let you to select the android SDK location folder, just select above folder.
  5. You can also change the android SDK location folder in the Android Studio Settings dialog.
  6. For Windows, start Android Studio, then click File -> Settings menu item.
  7. For macOS, start Android Studio, then click Android Studio -> Preferences menu item.
  8. Select Appearance & Behavior -> System Settings -> Android SDK menu item in the popup window left side.
  9. On the window right side, click the Edit link after the Android SDK Location text box, it will open the SDK setup dialog.
  10. At the bottom of the SDK setup dialog, there is an Android SDK Location text box, you can browse the new Android SDK folder to use it.