Deploying Unity Games to Android

Step-by-step instructions to learn how to deploy an existing Unity game to your Android device or get a game ready for releasing to the Play Store.

In this tutorial, learn how to deploy your Unity game to an Android device.

Install the Java Development Kit

Download the JDK from Oracle
Install the JDK. Grab the 32-bit version; I wasn't able to get Unity to work with the 64-bit alternative.

Include java's bin directory in your PATH variable. On my 64-bit Win8 install, the path was "C:Program Files (x86)Javajdk1.8.0_20in". Yours will likely be something similar.

You should now be able to run "java" at the command line.

Install the Android SDK

Download the Android SDK
Unpack the SDK. Some of the names in this bundle can be quite long. So if you're on Windows, be careful about limitations on total path lengths. I got around this by unpacking to "C:A", a shorter than usual path.

Navigate to that directory, run the SDK Manager and make sure you've got the following installed:

  • An Android platform (2.3 or newer)
  • Platform tools
  • USB drivers

Here's what I've got installed.

Setup the Device

To allow unsigned Android application packages (APKs) on your device, you'll need to modify some settings. Go to Settings -> Developer options. On Android 4.2 (Jelly Bean) and higher, these options have been hidden and adding them to the menu requires extra steps:

  1. Go to Settings -> About Phone.
  2. Find Build Number and tap it 7 times.
  3. You should see a message confirming you as a developer.

Once you get into the developer options, enable USB Debugging and Allow Mock Locations.

Plug in your device over USB, and you should see a message like "USB debugging connected".

Heads up: some devices will need additional manufacturer specific drivers. As an example, I needed these for my Nexus 5.

Build and Run from Unity

Start Unity. Go to Edit -> Preferences -> External Tools. Point the Android SDK Location to the appropriate location ("C:Aadt-bundle-windows-x86_64-20140702sdk" in my case).

Go to File -> Build Settings. Select Android and click the Player Settings button. Set everything up the way you'd like. The Bundle Identifer setting is required and should follow conventions (com.finalparsec.towerdefense for example).

Select Build And Run, select a location for your .apk, and the game should start up on your device.

Continue the discussion with us: @Final_Parsec

Note If you're still having trouble deploying games to your device and you're on Windows, take a look at this supplementary article I wrote. There is one more setting worth double checking.

Recommended posts

We have similar articles. Keep reading!

Aurora TD Released on Web and Android Devices!

Aurora Tower Defense has just been released for PC, Mac, and Android devices. Play for free in your browser now!

How to set up Visual Studio Code for Unity

All of the Visual Studio Code Extensions you'll need to get started using it with Unity3D.

Announcing the Tower Defense Tutorial Video Series!

The first video tutorial of a series which takes you through the process of building a tower defense game.

How to Connect Visual Studio to Unity

Adding Visual Studio to your workflow may make the difference between finished project and flash in the pan.

Comments

Log in or sign up to leave a comment.