Skip to content

Instantly share code, notes, and snippets.

@tshego3
Last active April 5, 2026 11:31
Show Gist options
  • Select an option

  • Save tshego3/4ce3a18448911b4169b5cb799100b52c to your computer and use it in GitHub Desktop.

Select an option

Save tshego3/4ce3a18448911b4169b5cb799100b52c to your computer and use it in GitHub Desktop.
This Gist provides a complete, step-by-step walkthrough for installing the Android SDK manually on Windows 11/10 and macOS (Apple Silicon/Intel) without the overhead of Android Studio.

Android SDK Manual Setup Guide

This guide installs the Android SDK to C:\Program Files (x86)\Android\android-sdk (Windows) and /Library/Android/sdk (macOS) using the Microsoft Build of OpenJDK.


1. Install Microsoft OpenJDK

The Android SDK Manager is a Java application. Using the Microsoft Build ensures long-term support and stability.

  1. Download: Go to the Microsoft OpenJDK Download Page.
  2. Version: Choose OpenJDK 17 (LTS).
  3. Installation:
    • Windows: Run the .msi. Crucial: Select the feature "Set JAVA_HOME variable" during the wizard.
    • macOS: Run the .pkg.

2. Download the Android Binary Zips

Navigate to the Android SDK tools guides and scroll to the bottom.

  1. Command line tools only: Download the zip for your OS (e.g., commandlinetools-win-xxxx_latest.zip).
  2. SDK Platform-Tools: Download the "SDK Platform-Tools" zip (this contains adb).

3. The "Latest" Folder Hack (Mandatory)

The SDK tools will not run unless they are nested inside a folder named latest.

Windows Setup

  1. Root Folder: Create C:\Program Files (x86)\Android\android-sdk.
  2. Platform Tools: Extract platform-tools-latest-windows.zip directly into the root.
    • Path: ...\android-sdk\platform-tools\adb.exe
  3. Command Line Tools: * Create ...\android-sdk\cmdline-tools\latest.
    • Extract the contents of your command line tools zip into that latest folder.
    • Path: ...\android-sdk\cmdline-tools\latest\bin\sdkmanager.bat

macOS Setup

  1. Root Folder: Create /Library/Android/sdk.
  2. Structure: Follow the same logic as Windows.
    • Path: /Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager

4. Setting Environment Variables

This is the "glue" that makes the tools work.

Windows

  1. Search for "Edit the system environment variables".
  2. Click Environment Variables.
  3. System Variables (New):
    • JAVA_HOME: C:\Program Files\Microsoft\jdk-17.x.x-hotspot (Verify your actual install path).
    • ANDROID_HOME: C:\Program Files (x86)\Android\android-sdk
  4. Path Variable (Edit): Add these three lines:
    • %JAVA_HOME%\bin
    • %ANDROID_HOME%\cmdline-tools\latest\bin
    • %ANDROID_HOME%\platform-tools
    • %ANDROID_HOME%\emulator

macOS (Zsh)

Open terminal, run nano ~/.zshrc, or open ~/.zshrc and add:

# Java Home (Microsoft OpenJDK)
export JAVA_HOME=/Library/Java/JavaVirtualMachines/microsoft-21.jdk/Contents/Home

# Android Home
export ANDROID_HOME=/Library/Android/sdk

# Update Path
export PATH=$PATH:$JAVA_HOME/bin
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator

Save (Ctrl+O, Enter) or (Ctrl+S) and Exit (Ctrl+X). Run source ~/.zshrc.


5. Fetching Build-Tools & Licenses

Now that the paths are set, finish the installation via terminal (Use Admin PowerShell on Windows).

# 1. Update tools
sdkmanager --update

# 2. Download Build-Tools and Platform (e.g., API 36)
sdkmanager "build-tools;36.0.0" "platforms;android-36"

# 3. Install an Android emulator
sdkmanager --install emulator
sdkmanager --install "system-images;android-36;google_apis;arm64-v8a"
avdmanager create avd -n AVD-API36 -k "system-images;android-36;google_apis;arm64-v8a"

# 4. Accept Licenses (The most important step)
sdkmanager --licenses

# 5. Launch the android virtual device
# emulator -avd AVD-API36

6. Verification

Run these commands to ensure everything is perfect:

  • java -version (Should show Microsoft OpenJDK)
  • echo %JAVA_HOME% (Windows) or echo $JAVA_HOME (Mac)
  • adb version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment