Search Unity

Isn't there no way to show debug console in standalone build?

Discussion in 'Scripting' started by leegod, Oct 17, 2011.

Thread Status:
Not open for further replies.
  1. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,476
    Hi.

    I have many Debug.Log("something"); in my entire code.

    But I want to see it at standalone build too.

    How?

    Build Setting's [Development Build] checkbox is related?

    I tested checked it and run, but still can't see debug console message, it just show screen's right-below's "Development build" white text.
     
    arthen598 likes this.
  2. Diviner

    Diviner

    Joined:
    May 8, 2010
    Posts:
    677
    You'll have to do it yourself, Unity doesn't support Debug on standalone builds as far as I know.

    In this case, IO to the rescue!

    Debugger.js

    Code (csharp):
    1.  
    2. import System;
    3. import System.IO;
    4.  
    5. static function Log (debugMsg : String) {
    6.       var path : String = Application.dataPath+"/debugLog.txt";
    7.       var sw : StreamWriter = new StreamWriter(path, true);
    8.       sw.WriteLine(debugMsg+"\n");
    9.       sw.Close();
    10. }  
    11.  
    Don't attach the Debugger.js anywhere, it works just by being at your Project Tab.

    All you need to do from now on is use Debugger.Log( ) instead of Debug.Log( ). The debug messages will be sent to the debugLog.txt file in your game's folder (it will create a new file if none exists).
     
    DrKucho likes this.
  3. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,476
    oh it works! Thank.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    sure Debug works.
    it writes into the log thats created. On windows builds its output.txt in the xxx_data folder, on osx its in ~/Library/Logs/Unity/player.log

    alternatively search the board for DebugStreamer for example
     
    Deleted User likes this.
  5. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,476
    @dreamora

    Thx. you are right. It just written in output.txt
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can always just click on "Open player log" in the editor; you don't have to worry about where the debug.log output actually is.

    --Eric
     
  7. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    that only works on osx. windows has no bloated ultra log folder like osx, its per application or not present at all if you disabled logging.
     
  8. KristianHJ

    KristianHJ

    Joined:
    May 28, 2010
    Posts:
    350
Thread Status:
Not open for further replies.