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:
- Go to
Settings -> About Phone
. - Find
Build Number
and tap it 7 times. - 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!
Creating Health Bars using Unity GUI Textures
Technical talk from Matt Bauer about Unity creating scaling health bars in Nauticus Act III, the RTS style conclusion to Nauticus.
How to Install Unity3D and Unity Hub
Follow our step-by-step guide for beginners to get started installing and running Unity3D.
Parallax for Dummies
An enlightening guide on how to create a simple parallax effect in Unity. Using parallax is a really cool way to breathe life into your games.
Tower Defense Tutorials Part 3
The third video tutorial of a series which takes you through the process of building a tower defense game.