Learn how to deploy an existing Unity game to your android device.
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.
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.
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
Setup the Device
To allow unsigned Android application packages (APKs) on your device, you'll need to modify some settings.
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.
Build Numberand 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.
Android SDK Location to the appropriate location (
"C:Aadt-bundle-windows-x86_64-20140702sdk" in my case).
File -> Build Settings.
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).
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.