From fa17c49eb1713d7966318b1be53e41d76afe3925 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Tue, 7 Jan 2025 21:11:37 -0600 Subject: [PATCH] Add starting adb log collecting button. --- Source/Editor/Windows/GameCookerWindow.cs | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Source/Editor/Windows/GameCookerWindow.cs b/Source/Editor/Windows/GameCookerWindow.cs index a44cae6a5..81b120937 100644 --- a/Source/Editor/Windows/GameCookerWindow.cs +++ b/Source/Editor/Windows/GameCookerWindow.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using FlaxEditor.Content.Settings; @@ -13,6 +14,7 @@ using FlaxEditor.Utilities; using FlaxEngine; using FlaxEngine.GUI; using FlaxEngine.Utilities; +using Debug = FlaxEngine.Debug; using PlatformType = FlaxEngine.PlatformType; // ReSharper disable InconsistentNaming @@ -376,6 +378,7 @@ namespace FlaxEditor.Windows FileName = Path.Combine(sdkPath, "emulator", "emulator.exe"), Arguments = "-list-avds", RedirectStandardOutput = true, + CreateNoWindow = true, }; var process = new System.Diagnostics.Process @@ -462,6 +465,7 @@ namespace FlaxEditor.Windows FileName = Path.Combine(sdkPath, "platform-tools", "adb.exe"), Arguments = "devices -l", RedirectStandardOutput = true, + CreateNoWindow = true, }; var process = new System.Diagnostics.Process @@ -565,6 +569,35 @@ namespace FlaxEditor.Windows FlaxEngine.Platform.CreateProcess(ref processSettings1); } }; + + var adbLogButton = emulatorGroup.Button("Start adb log collecting").Button; + adbLogButton.TooltipText = "In debug and development builds the engine and game logs can be output directly to the adb."; + adbLogButton.Clicked += () => + { + + var processStartInfo = new System.Diagnostics.ProcessStartInfo + { + FileName = Path.Combine(sdkPath, "platform-tools", "adb.exe"), + Arguments = "logcat Flax:I *:S", + }; + processStartInfo.CreateNoWindow = false; + processStartInfo.WindowStyle = ProcessWindowStyle.Normal; + + var process = new System.Diagnostics.Process + { + StartInfo = processStartInfo + }; + process.Start(); + /* + CreateProcessSettings processSettings = new CreateProcessSettings + { + FileName = Path.Combine(sdkPath, "platform-tools", "adb.exe"), + Arguments = $"logcat Flax:I *:S", + //LogOutput = true, + }; + FlaxEngine.Platform.CreateProcess(ref processSettings); + */ + }; } } else