Search Unity

Coming from iOS, how to debug on Android?

Discussion in 'Android' started by Jelmersb, Oct 28, 2018.

  1. Jelmersb

    Jelmersb

    Joined:
    Jul 12, 2016
    Posts:
    66
    I just switched from iOS to Android and am very confused and most guides seem out of date.
    I am used to see my debug logs in XCode.

    Goal/expectation:
    I press build&run in Unity -> the app runs on the phone and I can see debugging information, presumably in Android Studio?

    So far:
    When I select Build&Run, the app runs but I don't see debugging info anywhere
    When I do "Build" and manually open the APK in Android Studio and press the Debug button (Bug+playicon), I gett errors in the debugger:
    Screen Shot 2018-10-28 at 11.44.03.png


    Also on the Phone (Samsung S8), you can specifically select an app to debug. It remains unclear to me if this should be done or not?

    And then about all the options:
    IL2CPP or Mono?
    Player settings: development build+autoconnect profiler+script debuging? (on iOS you get debug information anyway so you don't need to worry about these)
    Should I install ADB?
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,900
    Can you clarify are you talking about native debugging or managed debugging, judging from your screenshot you're trying to perform native debugging.

    SIGPWR exception is used by managed debugger, and is thrown because you've enabled script debugging in build player window. So if you still want to do native debugging, you should either disable script debugging, or you should instruct Android Studio to ignore SIGPWR exception.

    If you we're able to build & run for Android, you already have adb installed.

    If you want to see the log, simply do adb logcat -s Unity from the console.