Search Unity

how to start LogCat?

Discussion in 'Android' started by jister, May 1, 2012.

  1. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    hey I'm trying to Debug my android project i test on my device.
    I first tried to get ConsoleDebugger.cs to work but i haven't got a clue on how to use it... i tried just putting it on an empty GO, but i don't see any GUI orso once testing...?
    so i started looking for an other way which is logcat, i have the adb.exe under platformtools, but i'm confussed on how to get it to run. if i double click it i get a command window for a second and then it closes by itself.

    i read i need to activate it by the $ adb logcat command have don't know where to input it... i tried it in cmd but that didn't go...

    any clues are welcome :)
     
  2. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    The folder where the adb.exe is installed needs to be in a folder where windows can find it (PATH variable).

    You can of course open the command line (cmd.exe in Windows). If the folder is not in the path variable, you have to switch there before you enter it, i.e. (assuming you installed the SDK in C:\AndroidSDK\

    HTML:
    C:\> cd AndroidSDK\platform-tools
    C:\AndroidSDK\platform-tools\> adb.exe logcat
    
    Where C:\> is the commandline promt (telling you in which folder you are).
     
  3. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    thanks i think i got it up, but wow i don't know where to find maybe Debug.Log from my code, i do get a lot of info like nr of verts and framerate and so on...
     
  4. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    Disable the logcat profile in your project (Edit > Project Settings > Player Settings > Android > Other Settings > Enable 'logcat' profiler.

    Additionally you may want to set "Script Debugging" in Build options, so you can see thrown exceptions and other script related stuff
     
  5. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    thx that's beter ;-)
     
  6. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    I have a list i fill with the rigidbodies of a list of gameobjects.
    I'm trying to set every first rigidbodies to every next gameobject as connectedBody of a hinge joint, i empty both list via index
    I see the rigidbody list get filled and emptied, but how can i debug to see which connectedbody is assigned? because the behavior isn't what it should be.
    atm I'm trying this

    index = Random.Range(0, tentacleParts.Count); //should i be doing this? don't really looked into how to accses them 1 by 1
    clone = Instantiate(tentaclePart, relativeTP, transform.rotation) as GameObject;
    clone.hingeJoint.connectedBody = (Rigidbody)connectedB[index]; //not sure this is working
    connectedB.Remove(connectedB[index]);
    Debug.Log(connectedB); //line 80
    Debug.Log(clone.hingeJoint.connectedBody); //line 81

    debug from logcat:

    tentacle (UnityEngine.Rigidbody)
    UnityEngine.Debug:Internal_Log(Int32, String, Object)
    UnityEngine.Debug:Log(Object)
    drawTentacles:Update() (at C:\Users\ROTTJUNG\Documents\New Unity Project\Assets
    ROBOT\scripts\drawTentacles.cs:80)

    (Filename: C Line: 0)

    181
    UnityEngine.Debug:Internal_Log(Int32, String, Object)
    UnityEngine.Debug:Log(Object)
    drawTentacles:Update() (at C:\Users\ROTTJUNG\Documents\New Unity Project\Assets
    ROBOT\scripts\drawTentacles.cs:81)

    so tentacle is the prefab(tentaclePart) that gets cloned 250 times. so if I'm right thats what line 80 tells me on debug: tentacle (UnityEngine.Rigidbody) but how to be sure it's the one from the previous tentacle? can i debug the number of the index orso?
     
  7. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
    Easter egg for you. If you type:

    Code (csharp):
    1. adb.exe lolcat
    it also works :D:D
     
  8. Deleted User

    Deleted User

    Guest

  9. mushroomrisotto

    mushroomrisotto

    Joined:
    Dec 9, 2013
    Posts:
    24
    This tutorial might help you its easy to implement, just convert a simple java class that logs to DDMS to a jar file add it to Unity and write a simple plugin to use it, then you can view your logs from Eclipse DDMS tool ..
    http://nevzatarman.wordpress.com/
     
  10. robinwood

    robinwood

    Joined:
    Dec 2, 2015
    Posts:
    18
    Last edited: Mar 29, 2016