Set Up Android Studio, SDK and ADB on Your PC

21 min read Step‑by‑step guide to install Java, Android Studio, SDK tools and ADB on Windows, macOS or Linux, plus troubleshooting tips for a smooth Android development start. September 27, 2026 18:00 How to Set Up a Complete Android Development Environment on Your PC

Whether you want to build your first "Hello World" app or start experimenting with ADB commands, a correctly configured development environment is the foundation of every Android project. This tutorial walks you through the entire process on Windows, macOS, and Linux – from installing the Java Development Kit (JDK) to running a sample project on an emulator or a real device. Along the way we explain why each step matters, what you should see on screen, and how to recover from the most common hiccups.

Before You Start

  • System requirements: 8 GB RAM (16 GB recommended), 2 GHz CPU, at least 5 GB free disk space for Android Studio and SDK components.
  • Administrative rights: You need to be able to install software and modify system environment variables.
  • Internet connection: Required to download the installer, SDK packages and emulator system images.
  • Backup: If you already have a previous Android SDK installed, note its location – the wizard can reuse it, but a fresh install avoids version clashes.
All commands shown for Linux/macOS are also valid on Windows PowerShell after replacing the path separator (use \ instead of /).

Step 1 – Install the Java Development Kit (JDK)

Android Studio relies on the Java compiler to translate your code into byte‑code. The official Android build system is compatible with OpenJDK 11 and later. Installing the correct JDK prevents obscure build‑time errors like "Unsupported major.minor version".

1.1 Choose a JDK distribution

  • OpenJDK – free, open source, available from Adoptium.
  • Oracle JDK – optional, but requires a free Oracle account for commercial use.

1.2 Install on Windows

  1. Download the .msi installer for the latest OpenJDK 11.
  2. Run the installer and accept defaults. Note the installation folder (e.g., C:\Program Files\OpenJDK\jdk-11.0.22).
  3. When the installer finishes, open Control Panel > System > Advanced system settings > Environment Variables.
  4. Add a new system variable named JAVA_HOME with the JDK path as its value.
  5. Append %JAVA_HOME%\bin to the existing Path variable.

1.3 Install on macOS

  1. Use Homebrew: brew install openjdk@11.
  2. After installation, Homebrew prints a command to add the JDK to your shell profile. Copy it, for example:
    echo 'export PATH="/usr/local/opt/openjdk@11/bin:$PATH"' >> ~/.zshrc
    export JAVA_HOME="$(/usr/libexec/java_home -v11)"
  3. Run source ~/.zshrc (or restart the terminal) and verify with java -version.

1.4 Install on Linux (Debian/Ubuntu)

  1. Run sudo apt update && sudo apt install openjdk-11-jdk.
  2. Confirm the installation with java -version – you should see openjdk version "11.
  3. Add JAVA_HOME to ~/.bashrc:
    export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::")
    export PATH=$JAVA_HOME/bin:$PATH

After this step, typing javac -version should return a version number starting with 11.

Step 2 – Download and Install Android Studio

Android Studio bundles the IDE, the Android SDK, platform‑tools (including ADB), and the emulator. Installing it in one go eliminates version mismatches.

2.1 Get the installer

  • Visit the official page at developer.android.com/studio and click the download button for your OS.
  • The file will be .exe (Windows), .dmg (macOS) or a .zip archive (Linux).

2.2 Install on Windows

  1. Run the .exe and follow the wizard. Accept the default installation path (e.g., C:\Program Files\Android\Android Studio).
  2. When prompted, let the installer also download the Android SDK and the latest Android platform.
  3. Finish the wizard and launch Android Studio.

2.3 Install on macOS

  1. Open the .dmg, drag the Android Studio icon into /Applications.
  2. Launch Android Studio from the Applications folder. The first‑run wizard will appear automatically.

2.4 Install on Linux

  1. Extract the .zip to /opt/android-studio (or any location you prefer).
    sudo unzip android-studio-*-linux.zip -d /opt/
  2. Create a symbolic link for easy access:
    sudo ln -s /opt/android-studio/bin/studio.sh /usr/local/bin/android-studio
  3. Run android-studio from a terminal. The setup wizard will guide you through SDK installation.

At the end of this step you should see the Android Studio welcome screen.

Step 3 – Run the First‑Launch Wizard

The wizard performs three essential tasks: download the Android SDK, install platform‑tools (including ADB), and create a default virtual device (AVD). Skipping any part leads to missing components later.

3.1 Choose the installation type

  • Standard – recommended for most users; it installs the latest stable SDK, emulator, and a set of common system images.
  • Custom – lets you pick specific SDK platforms or older system images. Use this only if you need a legacy API level.

3.2 Accept licenses

The wizard will display the Android SDK license agreement. Click Accept for each item. Without accepting, the SDK manager will refuse to download packages.

3.3 Verify the SDK path

By default Android Studio stores the SDK in %LOCALAPPDATA%\Android\Sdk (Windows), ~/Library/Android/sdk (macOS) or ~/Android/Sdk (Linux). You can change it, but keep note of the location – you’ll need it when setting ANDROID_HOME later.

3.4 Finish and launch

When the wizard completes, Android Studio opens the Welcome screen. Click Start a new Android Studio project to confirm that everything works.

Step 4 – Verify SDK Tools and ADB

Even though the wizard installs the tools, it’s good practice to double‑check that the command‑line utilities are reachable.

4.1 Open a terminal / command prompt

  • Windows: Win + R, type cmd, press Enter.
  • macOS / Linux: open Terminal.

4.2 Run adb version

If the SDK path is correctly added to PATH, you should see something like:

Android Debug Bridge version 1.0.41
Version 31.0.3-7562133

If you get "'adb' is not recognized", the PATH entry is missing – we’ll fix it in the next step.

4.3 Run sdkmanager --list

This lists installed and available SDK packages. You should see the platform‑tools, build‑tools, and at least one Android platform (e.g., platforms;android-33).

Step 5 – Configure Environment Variables

Setting JAVA_HOME, ANDROID_HOME (or ANDROID_SDK_ROOT) and updating PATH makes the tools usable from any terminal, which is essential for ADB, Gradle builds, and third‑party scripts.

5.1 Define ANDROID_HOME

  • Windows: create a new system variable named ANDROID_HOME with the SDK folder path (e.g., C:\Users\YourName\AppData\Local\Android\Sdk).
  • macOS/Linux: add to your shell profile (~/.zshrc or ~/.bashrc)
    export ANDROID_HOME=$HOME/Library/Android/sdk  # macOS default
    # or
    export ANDROID_HOME=$HOME/Android/Sdk  # Linux default

5.2 Append SDK tools to PATH

Add the following directories:

# Windows (system variable Path)
%ANDROID_HOME%\platform-tools
%ANDROID_HOME%\emulator

# macOS / Linux (profile file)
export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator

5.3 Verify the setup

  1. Close and reopen the terminal (so the new variables are loaded).
  2. Run echo $JAVA_HOME (macOS/Linux) or echo %JAVA_HOME% (Windows) – it should print the JDK path.
  3. Run adb devices. You should see a line that says List of devices attached with no devices listed yet – that means ADB is functional.

Step 6 – Create and Run a Sample Project

Now that the environment is ready, let’s build the classic "Hello World" app to prove everything works end‑to‑end.

6.1 Start a new project in Android Studio

  1. From the Welcome screen click Start a new Android Studio project.
  2. Select the Empty Activity template and click Next.
  3. Enter a Name (e.g., HelloWorld), a Package name (e.g., com.example.helloworld), and choose a Save location you can easily access.
  4. Set Language to Java or Kotlin – both are supported. This tutorial uses Java for simplicity.
  5. Choose the Minimum SDK. API 21 (Android 5.0) is a safe baseline for most devices.
  6. Click Finish. Android Studio will generate the project and sync Gradle.

6.2 Run on the built‑in emulator

  1. Click the Run button (green triangle) in the toolbar.
  2. A dialog titled Select Deployment Target appears. Click Create Virtual Device… if no AVD exists.
  3. Choose a device definition (e.g., Pixel 5) and click Next.
  4. Select a system image – the wizard will recommend a recent x86_64 image with Google Play. Click Download if not present, then Next and Finish.
  5. Back in the deployment dialog, select the newly created AVD and click OK.

The emulator boots (this may take a minute). When it finishes, Android Studio builds the app, installs it, and launches it. You should see a screen that says "Hello World!" – that confirms the toolchain works.

6.3 Run on a physical device (optional)

  1. Enable Developer options on the phone: Settings > About phone > tap Build number seven times.
  2. Open Developer options and toggle USB debugging on.
  3. Connect the phone via USB. If prompted on the device, accept the RSA key fingerprint.
  4. In Android Studio, click Run again. The device should appear in the deployment dialog. Select it and press OK.

The app installs and launches on the phone. If adb devices shows the device as unauthorized, re‑check the RSA prompt.

Step 7 – Set Up an Emulator for Faster Iterations

Running on an emulator is convenient, but performance can vary. Below are tweaks that make the experience smoother.

  • Use x86 system images – they run under Intel HAXM (Windows/macOS) or Hypervisor.Framework (macOS) and are far quicker than ARM images.
  • Enable hardware acceleration:
    • Windows: Install Intel HAXM via the SDK Manager (SDK Tools tab).
    • macOS: The Hypervisor framework is built‑in; just ensure the emulator settings have "Use Host GPU" enabled.
    • Linux: Install qemu-kvm and add your user to the kvm group.
  • Allocate sufficient RAM – 2 GB is a good start for a Pixel‑class AVD. Avoid allocating more than half your system RAM.
  • Enable snapshot – in the AVD manager, edit the device and check "Cold boot snapshot". This speeds up subsequent launches.

Step 8 – Connect a Physical Device via Wi‑Fi (Optional Advanced Step)

Debugging over Wi‑Fi removes the cable and can be handy for large devices or tablets.

8.1 Prerequisites

  • Device and PC must be on the same Wi‑Fi network.
  • USB debugging must be enabled (as described in Step 6.3).

8.2 Procedure

  1. Connect the device via USB once.
  2. Open a terminal and run adb tcpip 5555. This restarts ADB in TCP mode on port 5555.
  3. Disconnect the USB cable.
  4. Find the device’s IP address (Settings > About phone > Status > IP address).
  5. Run adb connect device_ip:5555. You should see "connected to device_ip:5555".
  6. Now you can run or debug apps wirelessly from Android Studio.
If you lose the connection, simply repeat the steps or run adb kill-server && adb start-server.

Step 9 – Common Issues and Troubleshooting

Even with careful steps, things can go wrong. Below are the most frequent roadblocks and how to resolve them.

9.1 "Java version not supported" during Gradle sync

  • Cause: Android Studio is using a JDK newer than 11 (e.g., JDK 17) while the project’s Gradle wrapper expects 11.
  • Fix: In Android Studio, go to File > Project Structure > SDK Location and set JDK location to the OpenJDK 11 folder you installed earlier.

9.2 adb not found or "command not recognized"

  • Cause: platform-tools directory is not in PATH or the variable change wasn’t applied.
  • Fix: Re‑open the terminal after editing environment variables, or manually run %ANDROID_HOME%\platform-tools\adb.exe (Windows) to confirm the file exists.

9.3 Emulator hangs on boot

  • Cause: Hardware acceleration not enabled, or insufficient RAM allocated.
  • Fix: Verify HAXM (Windows) or KVM (Linux) is installed and running. Reduce the AVD RAM to 1‑2 GB and enable "Cold boot" in the AVD settings.

9.4 "INSTALL_FAILED_INVALID_APK" when installing manually

  • Cause: The APK was built for a different architecture or signed with a debug key that conflicts with an existing release version.
  • Fix: Uninstall any existing version of the app (adb uninstall com.example.app) before installing the new build.

9.5 Device shows "unauthorized" in adb devices

  • Cause: The RSA key prompt was dismissed or the device’s USB debugging authorizations got corrupted.
  • Fix: Re‑connect the USB cable, run adb kill-server && adb start-server, and accept the RSA prompt on the device.

Step 10 – Keeping Your Environment Up to Date

Android development moves quickly, but you don’t need to chase every beta release. A practical update schedule keeps you compatible without breaking existing projects.

  • Android Studio: Check Help > Check for Updates (Windows/Linux) or Android Studio > Check for Updates (macOS) once a month.
  • SDK Tools: Open SDK Manager > SDK Tools tab. Tick "Android SDK Platform‑Tools" and "Android Emulator" for updates.
  • JDK: Stick with the LTS version (currently OpenJDK 11). Newer LTS releases (e.g., 17) are supported by newer Android Gradle plugins, but migrating requires updating the Gradle wrapper.
  • Gradle: Let Android Studio prompt you when a newer Gradle plugin is available. Review the release notes for any breaking changes before applying.

After updating, repeat adb version and gradle --version to confirm the tools report the expected versions.

Wrapping Up

You now have a fully functional Android development environment that works across Windows, macOS, and Linux. By installing the JDK, Android Studio, configuring environment variables, and verifying ADB, you can compile, run, and debug apps on both emulators and real devices. The troubleshooting section should help you recover from the most common pitfalls, and the update checklist ensures you stay current without unnecessary disruption.

From here you can explore more advanced topics – such as using adb shell for device automation, integrating Jetpack libraries, or setting up CI pipelines. But the most important thing is to start coding. Open Android Studio, modify the activity_main.xml layout, hit Run, and watch your changes appear instantly on the device. Happy building!

User Comments (0)

Add Comment
We'll never share your email with anyone else.