Skip to main content

Configure Android SDK for Unity

Daniel Koprowski
Software Engineer & Tech Productivity Advocate

This is quick guide to all things you need to do before start Unity Android development. I gathered there things that I was always looking for and didn't found on Unity documentation. From step where those instructions would double you'll be pointed to proper documentation page.

1. Download and install JDK

If you want to develop for Android you will need to install Java and set environment variables.

Open the Oracle website and download newest JDK.

Android JDK for Unity: Oracle instructions A

On the next view choose your version (Windows?): Android SDK Unity: Oracle instructions B

Then click through Java installer.

>>> More on this blog: How to organize Unity project directories?

2. Setup Java environment variables

For Android / Unity purposes its only required to set up PATH variable. To do this you can install useful program called Patheditor. Otherwise, you can google how to setup PATH environment variable.

Unity SDK Android: Patheditor for path setup

If you would like to setup other environment variables for Java here are the examples:

JAVA_HOME : C:\Program Files\Java\jdk1.8.0_112
JDK_HOME : %JAVA_HOME%
JRE_HOME : %JAVA_HOME%\jre
CLASSPATH : %JAVA_HOME%\lib;%JAVA_HOME%\jre\lib
PATH : other-entries;%JAVA_HOME%\bin

Make sure that PATH doesn't contain references to another Java installation directory.

3. Download Android SDK.

Go to the bottom of the website and find Get just the command line tools section. We don't need Android Studio here. Choose command line tools like on the image below:

Unzip Android SDK for Unity integration

Unzip this to desired SDK location.

4. Install SDK components

Now we need to install Android components. We are not using Android Studio so we will need to run console.

To install those things we will use console tool called 'sdkmanager.bat'. It is inside \tools\bin\ directory of [Your AndroidSDK location] — in my example it was directly in custom folder on C: drive.

If you would like to check newest packages versions simply run sdkmanager.bat --list command. To run scripts in *.bat you need to enter command line. To do this get into [AndroidSDK]\tools\bin\ and in directory bar write cmd like on gif below:

Use cmd to install JDK and Android SDK for Unity

Don't rely on versions below — those was newest while I was writing this tutorial.

Install required packages like this:

sdkmanager.bat platforms;android-27
sdkmanager.bat platform-tools
sdkmanager.bat build-tools;27.0.1
sdkmanager.bat extras;google;usb_driver

6. Setup locations in Unity

Go to Edit/Preferences/External tools and setup paths according to locations you have choosen:

External tools in Unity settings with Android SDK

That's it. Now you can proceed with steps from Unity documentation. From third step or so.

>>> More on this blog: Why VS Code is the best IDE for Unity dev. What extensions are great?

... a few steps further. You are ready to become Unity Android Developer! Take a look below for even better start.

Daniel Koprowski avatar
Daniel Koprowski
Software Engineer & Tech Productivity Advocate
Unleash Your Potential with Progractivity! 🚀

Get ready to transform your daily duties into fulfilling experiences.

Subscribe to Progractivity newsletter and unlock a wealth of knowledge that empowers you to enhance your programming skills, boost efficiency, and transform your digital experiences into rewarding accomplishments.