- Home /
How to Debug in a standalone build?
I'm testing out some recoil effect for a shooter game. And it works perfectly in the editor. But when I create a build, the build doesnt do the effect. So I was wondering... Is there any way to make a build with a debugging console? Or something similar?
-thanks :)
EDIT: thanks for all the answers, but most of these are only alternate ways to display the Debug.Log(""); function. I need to see if there will be any compiler errors or nullrefferenceexceptions. Thanks for the answers though :)
actioscripter's answer (and now $$anonymous$$e too) do refer to the only alternative you can use to debug unhanded crashes: log files.
Check this plugin: https://www.assetstore.unity3d.com/en/#!/content/44935
Answer by dreammakersgroupAdmin · Nov 22, 2013 at 03:32 PM
check this tool http://u3d.as/content/dreammakersgroup/in-game-logs/5E8
This seems to be much better than DebugConsole! I wonder how it was done.
this tool view the logs which appears on editor console no need to make extra log + it show exceptions and unexpected error without loging it exactly same what editor console does
Thanks man. I know this question is old, but this works awesomely! Accepting this as an answer :)
Answer by ActionScripter · Jun 22, 2012 at 02:36 PM
There isn't an easy way to get a console for a build, but you can check the log file after you run it. The file will be in the data folder that comes with the build. It should list any errors encountered during runtime.
provided you have access to the system files, that is indeed an option.
I can't think of a case where it's not possible to access the log file... it's one level below the executable, in the data folder's top level.
if your app is sandboxed for any reason and out of your reach. when you deliver a product to iPad, for instance.
Answer by cregox · Jun 22, 2012 at 02:15 PM
Something similar. http://unifycommunity.com/wiki/index.php?title=DebugConsole
In other words, you sure can write your own DebugConsole which show up things at your own way. The only downside is you won't be able to double click the line at Unity's Console and get linked back to it in the source code.
Following the question edit, you want then to see the Log Files. It will depend on your platform, please refer to the docs. They're currently at: http://docs.unity3d.com/Documentation/Manual/LogFiles.html
But you still can use try & catch or simple error prevention and something like the DebugConsole. Maybe sending e-mails or a SOAP to your server reporting errors. It's much more recommended.
Answer by chi · Jun 22, 2012 at 03:18 PM
There´s an easy way too... Just download DbgView (http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx) and use OutputDebugString() to write to it.
C# Example:
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
public class Debug : MonoBehaviour
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern void OutputDebugString(string message);
void Start()
{
OutputDebugString("started...");
}
}
DbgView works, and shows all the Unity messages (internal and Debug.Log). However, it's pretty spammy since Unity includes stack information on every message. 1) is it possible yet to disable stack information on some or all Debug.Log calls? 2) how can I see these messages in the Visual Studio Output Window ins$$anonymous$$d of having to run DbgView?