-download and install android studio: https://developer.android.com/studio/index.html

-Make sure so also install Java JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html

-once both installed go into unity and select ‘Unity’ from the menu bar, then select ‘preferences’ then ‘external tools’. You’ll see 3 fields but just enter the paths for SDK and JDK (these are from the two installs you just did for java and android studio. For example: /Users/stephenwilliams/Library/Android/sdk /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/

-now open android studio

-select ‘configure’ -> ‘SDK manager’

-for now just select to install ‘android 4.4 (KitKat)’ from the platforms tab

-then go to the SDK tools tab and install the following: ‘android sdk build tools’ ‘android sdk platform-tools’ ‘android sdk tools ‘android support library’ ‘google play apk expansion library’ ‘google play billing library’ ‘google play licensing library’ ‘google play services’

-now in unity select ‘file’ -> ‘build settings’

-make sure platform is set to ‘android’ -select ‘player settings’

-enter a ‘company name’

-enter a ‘product name’

-add a ‘default icon’

-go to ‘other settings’ and enter a ‘bundle identifier’ for example: com.spunkyinteractive.risenshine

-enter a ‘version’

-select minimum API to be 4.4 kitkat

-select ‘publishing settings’

-click on the box for ‘create new keystore’

-click on ‘browse keystore’

-select a location for the keystore and enter a name (make note of this)

-beside ‘Alias’ click on the dropdown that says ‘Unsigned (debug) and select to create new

-enter the alias, and password for the keystore and save

-now open the command window on PC or Terminal on Mac

-Enter keytool -exportcert -alias <alias name> -keystore /Users/stephenwilliams/projects/p1/<keystore name>.keystore -list –v replaceing the <alias name> with the one entered in before and the <keystore name> with the one entered before as well

-after hitting enter you will be prompt for the password you made

-the window should now output the SHA1 code (save this for later, you’ll need it for google developer console)

-now in unity you under the publisher settings you can select the box for ‘use existing keystore’

-enter the ‘keystore password’ you made before

-under ‘key’ beside ‘alias’ select the key you made from the dropdown

-enter the same password for your keystore

-on your phone unlock the developer settings.

-to unlock developer settings go to ‘settings’ scroll down to ‘about phone’ enter that screen and tap on the build number 7 times

-now go back to the settings screen and enter the developer settings screen

-scroll down and ‘enable usb debugging’

-also in developer settings make sure usb mode is set to media transfer protocol’ MTP

-now attach your phone via USB to your PC

-in unity you can now select ‘Build and Run’

The only thing you’ll have to re-do when you re-open unity each time. is go to player settings and enter the keystore password.

Note: sometimes it wont build because it cant find the device. in that case just go to developer settings on the phone and make sure usb mode is still set to MTP

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment