Developing Android games in Unity is incredibly simple and well done in Unity, however getting your phone to sync to Unity is not all that easy. It took me days to figure out how to get them connected properly. Here is every single step that you need to take to get your environment set up to develop Android Unity Games and notes to help you deal with any of the problems that you might have along the way.
It seemed like everything that could have gone wrong went wrong when I was trying to get this installed, so I hope that this helps you to get it done faster than I did.
Step 1: Download the Android SDK
- Go to this web site: http://developer.android.com/sdk/index.html
- Press the big blue button
- Unzip the folder
- Rename the unzipped folder ‘Android’
- Move the folder to C:\
- Open the folder and click on ‘SDK Manager.exe’
- Android SDK Tools*
- Android SDK Platform-tools*
- Android 4.4.2 (API 19), or whatever the latest build is
- Android Support Library*
- Google USB Driver*
- Google Web Driver*
- Click ‘Install x Packages’
* These are the only things that you need to install, but you can just install the full Tools and Extra directory for simplicity.
Step 2: Prep Your Phone
- Download ‘Unity Remote’ in the Google Play Store.
- Go to Developer Options and check off:*
- Stay Awake**
- USB Debugging **
- Allow Mock Locations**
- Plug your phone into your computer.
- Wait for it to open as a USB device.``
- Launch ‘Unity Remote’
* In Android Jellybean and higher the developer options are hidden. You can make them available by going to Settings > About Phone and tapping Build Number until the developer options are unlocked (Yes, you literally tap on it until it unlocks developer settings). You can also tap on the Android version for a nice easter egg.
** Turn these off when you get done developing. Otherwise your phone might be vulnerable to getting viruses and the battery will get drained.
`` If your phone doesn’t connect as a USB device then go download your phone’s USB driver from their website. (ex. I have a Samsung Galaxy S3, so i go to samsung.com and download my driver).
Step 3: Launch Unity
- If you don’t have Unity installed then do that now at: http://unity3d.com/unity/download
- Create a new project with the ‘standard assets (mobile)’ box checked.
- Go to Edit > Preferences… > External Tools and set the ‘Android SDK Location’ to ‘C:\Android\sdk’
- Hit play
- Look at your phone
Step 4: It still ain't workin'
Close Unity and Unity Remote, unplug your phone, turn all the developer settings off, and do the following steps in the order specified:
- Turn your developer settings back on.
- Plug your phone into the computer and wait for your computer to notice your phone.
- Turn on Unity Remote App.
- Launch Unity
- Press play
I hope that that worked for everyone. Connecting multiple programs and devices together is incredibly difficult and I probably only encountered half of the possible problems you could have.