Skip to content

Instantly share code, notes, and snippets.

@asaromi
Last active May 14, 2023 13:16
Show Gist options
  • Save asaromi/e76d4ade2975c824669a0efcaad3a337 to your computer and use it in GitHub Desktop.
Save asaromi/e76d4ade2975c824669a0efcaad3a337 to your computer and use it in GitHub Desktop.
Setup Android SDK tools (without installing Android Studio)

Requirements

  • Java Development Kit
  • OS that compatible for Android SDK [Windows/macOS/Linux] (In my case, I use Windows 11)
  • Check the system requirements for the specific version of the Android SDK you want to install. (Different versions of the SDK may have varying hardware and software requirements)

Steps

  1. Visit the Android Developer website here and navigate to the "Command line tools only" section.
  2. Download the appropriate "Command line tools only" package for your operating system.
  3. Extract the downloaded package to a directory of your choice. (In my case, I extract the folder to C:\android-sdk)
  4. Go to the cmdline-tools folder. Make a new folder name latest and move all contents to latest folder.

Windows

  1. Configure Environment Variables:

    • Open the System Properties on your computer.
    • Create a new environment variable called $ANDROID_HOME and set its value to the directory where you extracted the Android SDK.
  2. Add the Android SDK Tools to the Path:

    • When back to the Environment Variables window, locate the "Path" variable.
    • Click on "Edit" and add the "New" following paths:
      • %ANDROID_HOME%\cmdline-tools\latest\bin
      • %ANDROID_HOME%\emulator
      • %ANDROID_HOME%\platform-tools
  3. Verify the installation by opening a command prompt or terminal and running the following command:

    sdkmanager --version

  4. Install desired SDK components:

    • Run the following command to list available SDK packages:

      sdkmanager --list

    • Identify the package names of the SDK components you want to install (e.g., platform-tools, build-tools, specific platform versions, etc.).
    • Run the following command to install the desired SDK components:

      sdkmanager "package1" "package2" ...

    Replace "package1", "package2", etc., with the actual package names you want to install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment