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

Is it possible to see console output on the console?

Discussion in 'Android' started by doomtoo, Jul 9, 2015.

  1. doomtoo

    doomtoo

    Joined:
    Feb 16, 2015
    Posts:
    41
    Is it possible to see console output ( Debug.log("This should show in console");) on Android/ any build platform besides testing in the editor?

    I come from Eclipse, and when you deploy to the device, you can see the System.out.println(), ect in the console when debugging.

    But in Unity so far, it appears to only show debug output when testing in the editor, and doesn't show any output when built & run on android (with 'development build' and 'script debugging' checked in build settings).

    Looking through the forums/stacktrace/the internet, I only find answers from 2010 to use logcat (which shows very few lines in the Windows command line).

    Can Unity output to the console like Eclipse, or is there a better way than quickly viewing 20 lines of debug text flying by from the logcat in the command line?
     
  2. Taz-dragon

    Taz-dragon

    Joined:
    May 21, 2015
    Posts:
    38
    If you have script debugging enabled, you can see that stuff by doing adb logcat -s Unity.
     
    gareoke likes this.
  3. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,555
    Actually, this has nothing to do with script debugging.
    On Android, you can see the output of all logs for any build.

    I usually look in Eclipse or Android studio, or from the command line:

    adb -d logcat -v time

    (shows a verbose output with time information).
     
  4. Taz-dragon

    Taz-dragon

    Joined:
    May 21, 2015
    Posts:
    38
    Oh really? I always though that's what it was. Huh.
     
  5. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,555
    script debugging only turns on the ability to debug your game (using a debugger).

    Unity has a built-in debug "layer" built into the engine. If you enable it, it will use this debug layer
     
  6. Taz-dragon

    Taz-dragon

    Joined:
    May 21, 2015
    Posts:
    38
    Wow... reminded again today how much I still need to learn. :D
     
  7. doomtoo

    doomtoo

    Joined:
    Feb 16, 2015
    Posts:
    41
    But there's no way you know of to see console output in the Unity console (In the same way you do when testing in the game editor)? Unity doesn't have the ability to receive the logcat info like Eclipse can, and display it in the console output?

    It's kind of crazy if Unity is behind eclipse for that feature. So then you are unable to debug your Unity game on any platform(iOS, ect) other than the WindowsEditor, and will need to use that platforms tools instead?

    And thanks for the hint about using eclipse at least to see the logs/debug output. Running logcat from the command line is almost completely unusable, since it stores very little lines, resets anything you select whenever it gets a new line, and would require you to either get rid of almost all debugging info, or be able to copy and paste the contents into a text editor within milliseconds.
     
    Last edited: Jul 10, 2015
  8. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,555
    There is a way, but it's not available out of the box.

    You can view the debug log output when running your game in the unity editor. Unity exports your game for android, so it lets other software, that was specifically designed for working with Android, show you the log output for that.

    You could however, create your own custom window that will show the logcat output (i suppose you could also look up maybe something is already available on the asset store).

    A quick search found this:
    https://www.assetstore.unity3d.com/en/#!/content/4515
     
  9. doomtoo

    doomtoo

    Joined:
    Feb 16, 2015
    Posts:
    41
    Ok, thanks for the help lortal! I'll use the logcat viewer in Eclipse to see what is happening Android side.

    Out of curiosity, what is your process for testing features that you can't use in the editor (such as ads, in app purchases, gyroscope/ multi touch input)? Do you use Eclipse or Android Studio (or something else) for viewing logcat? (or do you do more than just look at logcat for hints at why things aren't working the way you think they should).


    Thanks again! I had no way of moving forward without some way of seeing debug output (aside from the impossible to read/copy logcat via windows command line)
     
  10. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    guneyozsan and jprocha101 like this.
  11. robinwood

    robinwood

    Joined:
    Dec 2, 2015
    Posts:
    18
    I have made a plugin named Device Console.

    It provides an in-game console to view full Unity console logs on devices.

    It is implemented with UGUI, so it supports all the platforms Unity supports (Android, iOS, WindowsPhone...)

    And it's easy to use.

    You can check it out here: https://www.assetstore.unity3d.com/#!/content/44935

    Hope it could give you some help. Enjoy it :)
     
    Last edited: Mar 28, 2016
  12. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    @robinwood Don't necro threads to spam your wares.
     
  13. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    I usually make my own console, showing all the debug.log I need. Unfortunately this doesn't show the critical (marked in red color) errors, but for simple debugging I think it is the easiest.
     
  14. MMOARgames

    MMOARgames

    Joined:
    Feb 28, 2013
    Posts:
    24
    I'm surprised this isn't already built into the the Unity Remote, smh.
     
  15. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724