Configure Android SDK for Unity

November 29, 2017

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.

Written by Daniel KoprowskiFrontend Developer. Enthusiast of React, React Native and TypeScript. Reach me on Twitter.

Stop wasting your time on configuration

I have prepared a React Native boilerplate app where most of the configuration is done for you.

With Production Ready Forms you get a reusable project with a lifetime license.

Written in TypeScript, with authentication, API example, aliases, routing and best practices!


Progractivity Newsletter

Daniel Koprowski

Join the Progractivity newsletter and read about:

  • 🧐 Focus and productivity for life-long procrastinators seeking fulfilment.
  • 🚀 Product building for a solo frontend developer with a full-time job.
  • 🗞️ Audience building for a wannabe solopreneur that loves good design.

Stay in touch and learn with me!

I send emails about blog updates, frontend, my products, occasional surveys and special offers right to your inbox. Privacy policy.

More Articles

Progractivity

Daniel Koprowski

Join the Progractivity newsletter and read about:

  • 🧐 Focus and productivity for life-long procrastinators seeking fulfilment.
  • 🚀 Product building for a solo frontend developer with a full-time job.
  • 🗞️ Audience building for a wannabe solopreneur that loves good design.

Stay in touch and learn with me!

I send emails about blog updates, frontend, my products, occasional surveys and special offers right to your inbox. Privacy policy.