- Home /
Developer Console doesn't show up when using BuildOptions.Developer
I'm currently attempting to simplify the build process for our project as follows:
// Called from MenuItem functions..
public static void Build(bool server, bool client)
{
// Get the chosen directory, or use the default one.
var currDir = EditorPrefs.GetString("BuildDir");
if (currDir == "")
{
currDir = defaultDir;
}
BuildOptions customOptions = BuildOptions.Development | BuildOptions.AllowDebugging | BuildOptions.ShowBuiltPlayer;
if (client)
{
// Build the client
var clientLevels = new string[3];
clientLevels[0] = "Assets/Scenes/ClientScene.unity";
clientLevels[1] = "Assets/Scenes/MainScene.unity";
clientLevels[2] = "Assets/Scenes/UIScene.unity";
BuildPipeline.BuildPlayer(clientLevels, currDir + "/Client.exe", BuildTarget.StandaloneWindows64, customOptions);
}
if (server)
{
// Build the server
var serverLevels = new string[2];
serverLevels[0] = "Assets/Scenes/ServerScene.unity";
serverLevels[1] = "Assets/Scenes/MainScene.unity";
BuildPipeline.BuildPlayer(serverLevels, currDir + "/Server.exe", BuildTarget.StandaloneWindows64, customOptions);
}
}
I can't, however, seem to be able to get the developer console to show up. Normally it displays when you build a standalone player in developer mode, but it doesn't do so here.
I've also found the following command which should allow me to show it, but it doesn't do anything, either:
if (Debug.isDebugBuild)
{
Debug.developerConsoleVisible = true;
}
I've confirmed that the player is, indeed, in debug build when BuildOptions.Development is added.
Answer by fredsa · Aug 28, 2016 at 12:21 AM
The development console cannot be made to appear by setting Debug.developerConsoleVisible=true
. It can however be hidden by setting the value to false
.
Instead, you'll need to log an error to make the developer console appear:
// Console automatically appears once an error has been logged
Debug.LogError( "I am an Error" );
See http://docs.unity3d.com/ScriptReference/Debug-developerConsoleVisible.html for more details.
Your answer
Follow this Question
Related Questions
Cancel build in PostProcessScene? 0 Answers
Automate exclusion of specific Android plugin from build? 0 Answers
Copy a resource file to build directory? 3 Answers
Distribute terrain in zones 3 Answers