Wednesday, January 7, 2015

Unity 3D on Mac how to publish to android market

Okay, I never publish to android market using a mac in unity before, so I start from the beginning, the entire process took me 3 days because I encounter error after error, it took me 3 days to solve all

let begin

DOWNLOADING ANDROID SDK:
----------------------------------------------
Step 1. Download Android latest SDK, the android studio(443 MB )

Step 2. download the java JDE (183MB) and install it
- you need this before you can install the android studio

Step 3 Install the android studio


RUNNING EMULATOR:
----------------------------------------------
Step 1. Open sdk manager
- inside android studio -> tool -> android -> SDK manager

Step 2. Install some package to make emulator run faster
-> In SDK manager
-> install the latest tools, latest android API (example android 5.0.1(API21))
-> most important is the “Intel x86 Atom System Image”
-> under the extra “Intel hardware Accelerated Execution Manager”
-> under the extra "Google Play Service"

(before this, my emulator take 1 hour to load, after this, it took 3 minute to load)

Step 3. Manage AVD
-> On SDK Manager, on top, select tool -> Manage AVD
-> if no AVD, you create one AVD
—-> Device: choose NEXUS 1 (because if you choose NEXUS 5, it will lag like hell)
—-> target Android 5.0.1 API21
—-> CPU atom x86  (must choose this for faster emulator)
—-> SKIN: no skin
—-> Emulator option : Use Host GPU (must choose this for faster emulator)

-> select your AVD -> click start(this will launch the emulator)

BACK TO UNITY:
----------------------------------------------
Step1: While your emulator is running, Open unity

Step2: Manage your Keystore
->in unity, create new keystone, give a password
-> click browse, choose desktop, name it mykeystore(or name it anything you like)
-> press “key alias” put in all detail

Step3: Build Setting
-> under the build setting -> Install Location -> automatic (if you dont do this, it will fail, unable to find SD card)
-> under the build setting -> Graphics -> automatic (if you dont do this, it will fail with some error)
-> under chart boost -> edit setting   (you can skip this if you dont have chartboost)
(key in your app id, app signature)
(also click setup android SDK)  <-- (you must install google play service else will error)
-> choose build and run

BACK TO EMULATOR:
----------------------------------------------
Step1: after build success, your games should show up in the emulator
-> test test test

Step2: EMULATOR Shortcut
(FN+left arrow) this is the home button on emulator (press and hold to remove the app)
(FN+CONTROL+F12) this will rotate the emulator to landscape

DEBUGGING on EMULATOR:
----------------------------------------------
step1: Open terminal
- press F4, inside others-> Terminal

step2: go to your home directory (example, /users/john)

step3: open .bash_profile using textedit
open -e .bash_profile

step4: put this in
export ANDROID_HOME=/Users/john/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

step5: now you can use command such as android or emulator or adb

step6: close your terminal and restart

step6: type adb logcat
- in your new terminal , type adb logcat
- or adb logcat -v time

(now you should be able to see your emulator log, if the game error or freeze you can see the error and fix it accordingly)

PUBLISHING ON GOOGLE PLAY:
----------------------------------------------
Step1: Create a new account at google play developer, pay $25 to enroll
Step2: Create new app
Step3: Upload your APK file
Step4: Upload some screenshot, Description and other stuff
Step5: Click Publish


There you go, hopefully it can help you in some way, good luck =)




1 comment: