24 de jun. de 2018

Android - Debug your game (Unity)

There is no way, you´ll need to debug your game/app directly in your Android device.
So, for that, you need to:

  1. Set up Unity to Build in Developer mode
    1. File - Build Settings - Development Build
      1. Run Device - choose the device that is connected via USB, my example Lenovo A7010
      2. Script Debugging
    2. Build and Run
    3. Console - Choose "Android Player (XXXX)"
  2. Wait until your game starts into your device
  3. Set up Visual Studio 2017
    1. Debug - Attach Unity Debugger
      1. Your devices must be showed in the list, choose it.
  4. Now,  you just need to put breakpoints to stop the game and debug what you want.
Problem: The build freezes at the last part of the process: copying apk package when using "Build and Run". The solution is:
  • Changed the USB port (front to back por of the PC)
  • or Delete the app in the cellphone
I used "c:\adb>adb install -r Minigames.apk" to try to send the apk by command line, but it was not going.

Nenhum comentário: