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.
\ instead of /).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".
.msi installer for the latest OpenJDK 11.C:\Program Files\OpenJDK\jdk-11.0.22).JAVA_HOME with the JDK path as its value.%JAVA_HOME%\bin to the existing Path variable.brew install openjdk@11.echo 'export PATH="/usr/local/opt/openjdk@11/bin:$PATH"' >> ~/.zshrc
export JAVA_HOME="$(/usr/libexec/java_home -v11)"
source ~/.zshrc (or restart the terminal) and verify with java -version.sudo apt update && sudo apt install openjdk-11-jdk.java -version – you should see openjdk version "11.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.
Android Studio bundles the IDE, the Android SDK, platform‑tools (including ADB), and the emulator. Installing it in one go eliminates version mismatches.
.exe (Windows), .dmg (macOS) or a .zip archive (Linux)..exe and follow the wizard. Accept the default installation path (e.g., C:\Program Files\Android\Android Studio)..dmg, drag the Android Studio icon into /Applications..zip to /opt/android-studio (or any location you prefer).
sudo unzip android-studio-*-linux.zip -d /opt/
sudo ln -s /opt/android-studio/bin/studio.sh /usr/local/bin/android-studio
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.
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.
The wizard will display the Android SDK license agreement. Click Accept for each item. Without accepting, the SDK manager will refuse to download packages.
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.
When the wizard completes, Android Studio opens the Welcome screen. Click Start a new Android Studio project to confirm that everything works.
Even though the wizard installs the tools, it’s good practice to double‑check that the command‑line utilities are reachable.
Win + R, type cmd, press Enter.Terminal.adb versionIf 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.
sdkmanager --listThis 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).
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.
ANDROID_HOMEANDROID_HOME with the SDK folder path (e.g., C:\Users\YourName\AppData\Local\Android\Sdk).~/.zshrc or ~/.bashrc)
export ANDROID_HOME=$HOME/Library/Android/sdk # macOS default
# or
export ANDROID_HOME=$HOME/Android/Sdk # Linux default
PATHAdd 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
echo $JAVA_HOME (macOS/Linux) or echo %JAVA_HOME% (Windows) – it should print the JDK path.adb devices. You should see a line that says List of devices attached with no devices listed yet – that means ADB is functional.Now that the environment is ready, let’s build the classic "Hello World" app to prove everything works end‑to‑end.
HelloWorld), a Package name (e.g., com.example.helloworld), and choose a Save location you can easily access.Java or Kotlin – both are supported. This tutorial uses Java for simplicity.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.
The app installs and launches on the phone. If adb devices shows the device as unauthorized, re‑check the RSA prompt.
Running on an emulator is convenient, but performance can vary. Below are tweaks that make the experience smoother.
qemu-kvm and add your user to the kvm group.
Debugging over Wi‑Fi removes the cable and can be handy for large devices or tablets.
adb tcpip 5555. This restarts ADB in TCP mode on port 5555.adb connect device_ip:5555. You should see "connected to device_ip:5555".adb kill-server && adb start-server.
Even with careful steps, things can go wrong. Below are the most frequent roadblocks and how to resolve them.
adb not found or "command not recognized"platform-tools directory is not in PATH or the variable change wasn’t applied.%ANDROID_HOME%\platform-tools\adb.exe (Windows) to confirm the file exists.adb uninstall com.example.app) before installing the new build.adb devicesadb kill-server && adb start-server, and accept the RSA prompt on the device.
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.
After updating, repeat adb version and gradle --version to confirm the tools report the expected versions.
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!









