Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to Debug an Android Plugin

Discussion in 'Editor & General Support' started by davidosullivan, Feb 14, 2016.

  1. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    387
    Hi there I am just wondering if somebody has a link to or just some advice for how to debug an Android Plugin.

    I just need to be able to debug it like I usually would using the console so I can see why its not working.

    I know there are loads of bits of 'information' out there but I cannot understand a single thing they say and its driving me insane.

    Like this http://docs.unity3d.com/Manual/AttachingMonoDevelopDebuggerToAnAndroidDevice.html

    Its says 'Ensure your device is on the same subnet mask and gateway as your development machine' What does that mean?!? How do I do that? (I am on Windows 7 btw)

    And the second point, and the third?

    And this helpful post says
    Great... so what does 'with a trailing logcat parameter: $ adb logcat' mean. What do I do with that and how?!?

    If anyone could provide some step by step information for people who literally only know how to use Unity that would be amazingly helpful - and should DEFINITELY be added to the standard documentation for EVERYONE.

    Hope someone out there can help...
     
  2. felsi

    felsi

    Joined:
    Jul 3, 2013
    Posts:
    15
    logcat is a command line tool, you can use it on Windose with cmd.exe
    http://developer.android.com/tools/help/logcat.html
    cd to the location of the platform-tools (where you have installed the android sdk) and use it like:
    adb logcat -s Unity
    It will print the Debug.Log similar to the unity-console.
    If you build it as Development Build it will print more information. (i.e. backtrace of the Debug.Log)
    For not Unity related information, use another or don't use the filter -s Unity.

    Edit:
    And to show Log.d(TAG, debugText) of your Plugin use: -s TAG
     
    Last edited: Feb 16, 2016
  3. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    387
    Hey thanks so much for this info. It has been really helpful. I wish they had more detailed info like this in the docs...