How To Setup Android SDK Without Android Studio on Windows 11 from Scratch?

5 steps to prepare you for your Android Development journey.

Harvey Javier
SparkLearn EdTech
6 min readJul 29, 2022

--

Pre-requisites

Before we start, make sure you already have JDK or Java Development Kit installed. You can download it at the link below.

Once done, you may now proceed with the steps below.

Step 1 - Install the Command Line Tools and Set It Up Neatly on a Clean Directory

Go to https://developer.android.com/studio#downloads and scroll down to the Command line tools only section. Here you choose your platform. But for this article, we will use Windows.

Choose your platform. In this article, we will use Windows. Click on the highlighted zip file.

A modal will appear, displaying the Terms and Conditions in downloading Android Command Line Tools. Upon reading, you must check if you agree with the said terms and conditions. The download button will be clickable upon agreeing. Just click it, and the zip file will successfully download.

Upon downloading, head to your (C:) folder and create a new folder called src. Inside src, create a new folder called Android. Inside Android create a new folder called SDK.

This is how it should be like in your directory: C:\src\Android\SDK

Now copy your downloaded file, paste it inside C:\src\Android\SDK, and extract it.

Right-click on the .zip file and click on Extract All.
Make sure you extract it inside C:\src\Android\SDK.

Then you will see a cmdline-tools folder inside the C:\src\Android\SDK directory. Click it and create a new folder called tools. Put all the initial files of cmdline-tools inside tools.

Step 2 - Set the Command Line Tools Bin in the Environment Variables Path

Now click bin, and you’ll see the executable Windows Batch Files. We will add all of these to our Windows Environment. To add it, copy the link of the directory (C:\src\Android\SDK\cmdline-tools\tools\bin).

Press the Windows icon button on your keyboard, or click the Windows icon on your taskbar, and on the search input, type Environment. You’ll see the Edit the system environment variables button, then click it.

After setting the path, open your command line and type sdkmanager --list.

This command will display all available Android SDK packages including the build tools, android versions, AVDs (Android Virtual Devices), etc.

Step 3 - Install the Build Tools

Now let’s install the build tools. For this article, we will be using build-tools;30.0.1. Scroll further, look for it, and copy by highlighting and pressing Ctrl+Shift+C.

Now type on your console the sdkmanager command followed by the build tools you copied enclosed in quotation marks (sdkmanager “build-tools;30.0.1”).

Upon entering, this will prompt the license agreement form. Just type y and press Enter to accept it. After doing so, it will download the build tools. Just wait for a few minutes since it may take a while.

After downloading, you may look into your C:/src/Android/SDK directory and find the installed files.

Step 4 - Install the Android Platforms and Sources

Scroll down again from the list of packages returned by sdkmanager --list, and look for the Android version you prefer. For this article, I’ll be selecting platforms;android-30.

Like we did with build tools, copy it and install it with the sdkmanager command (sdkmanager “platforms;android-30”).

Upon entering, this will install the Android platform. Wait for a few minutes.

After installing, you may recheck your C:/src/Android/SDK directory to see a generated platforms folder containing your installed Android platform.

Then let’s proceed with sources. The same drill, just look for sources;android-30 from sdkmanager --list, copy it, and install via sdkmanager command.

Step 5 - Install the System Images, Create AVD, and Setup Emulator

Let’s install the System Images.

Now let’s look into our list of packages again via sdkmanager --list. Look for system-images;android-28;default;x86 and install it, the same procedure with the previous packages above.

Once installed, create the AVD.

AVD is a configuration defining the characteristics of an Android device that you will simulate in the Android Emulator.

Moving on, create the AVD device by typing the avdmanager create avd command followed by the name and package. For now, I’ll name it Android28 (avdmanager create avd --name “Android28” --package “system-images;android-28;default;x86”).

Upon successfully creating your AVD, you may check your available AVDs via the avdmanager list avd command.

Now to open your Emulator using the AVD you have generated, type the command emulator followed by the name of the AVD.

And to check your adb connection with your emulator, open another command line and type adb devices.

Your Android SDK is set up successfully. You’re now ready for your Android Development journey. Good luck!

Learn more about SparkLearn EdTech from the following links:

MOOC: lrn.ac
Twitter: lrn.ac/twitter
Facebook: lrn.ac/facebook
GitHub: lrn.ac/github
Instagram: lrn.ac/instagram
LinkedIn: lrn.ac/linkedin
YouTube: lrn.ac/youtube

--

--