Unity3D: build and run (debug mode) on android device (windows)

Trabla: Unity3D: build and run (debug mode) on android device ( os - windows).


Unity3D: build and run (debug mode) on android device  (windows)


Solving:

NOTE: Android Studio by default installs SDK 
into C:\Users\<User>\AppData\Local\Android\sdk 
Where <User> - your user in system.


1. Install Unity3D
https://unity3d.com/get-unity

Unity3D build and run (debug mode) on android device  ( windows 7 ) - codingtrabla tutorial 1


2. Install JDK ( java development kit )
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Unity3D build and run (debug mode) on android device  ( windows 7 ) - codingtrabla tutorial 2



3. Install Android Studio
https://developer.android.com/sdk/index.html

Unity3D build and run (debug mode) on android device  ( windows 7 ) - codingtrabla tutorial 3


4. Run  Android Studio -> select "Configure" -> "SDK Manager"
Unity3D build and run (debug mode) on android device  ( windows 7 ) - codingtrabla tutorial 4
Unity3D build and run (debug mode) on android device  ( windows 7 ) - codingtrabla tutorial 5

5. In Androdi SDK manager select all + click "Install"
Unity3D build and run (debug mode) on android device  ( windows 7 ) - codingtrabla tutorial 6


6. After all packages installed in SDK manager  - close SDK manager and  Android Studio

7. Connect your Android Phone to PC

8. Goto your Android Phone settings -> "Developer options"

Unity3D build and run (debug mode) on android device  ( windows 7 ) - codingtrabla tutorial 7

9. Enable "Developer options" + select checkbox "USB debugging"

Unity3D build and run (debug mode) on android device  ( windows 7 ) - codingtrabla tutorial 8

10. Run Unity - create dummy project

11. In Unity Editor click "File" -> "Build and Run"
Unity3D build and run (debug mode) on android device  ( windows 7 ) - codingtrabla tutorial 9

12. In "Build Settings" - select platform "Android" + add current scene + click "Player Settings"
Unity3D build and run (debug mode) on android device  ( windows 7 ) - codingtrabla tutorial 10


13. In Player Settings - select "android"
1. Change Company name
2. Click "Other Settings" 
3. Set "Bundle Identifier" - e.g. com.<YOURCOMPANY>.<PRODUCT>
example -  com.epicgames.supermario


Unity3D build and run (debug mode) on android device  ( windows 7 ) - codingtrabla tutorial 11


14. Click "Build And Run" in "Build Settings"

NOTE: Android Studio by default installs SDK 
into C:\Users\<User>\AppData\Local\Android\sdk 
Where <User> - your user in system.

ATTENTION: in real app set target frame rate - if not Unity will run your app in android with highest possible frame rate ( I tested with Sony Xperia Z - get 200 fps!!!! is ok when -  30 fps - 60 (3D games)  )

//Put it into main  game script
void Awake() 
{

    Application.targetFrameRate = 30;

}



No comments:

Post a Comment