Last active
December 11, 2023 05:00
-
-
Save udonba/ec78138e03bbb237d6ddd5bd280fc79a to your computer and use it in GitHub Desktop.
Open terminal that "adb" command available.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using System.IO; | |
using UnityEditor; | |
public static class TerminalExtensions | |
{ | |
[MenuItem("Window/Run Terminal (at android sdk path) %t")] | |
private static void RunTerminalAtAdbAvailableDir() | |
{ | |
var adbDir = Path.Combine(UnityEditor.Android.AndroidExternalToolsSettings.sdkRootPath, "platform-tools"); | |
Process p = new Process(); | |
p.StartInfo.FileName = System.Environment.GetEnvironmentVariable("ComSpec"); | |
p.StartInfo.Arguments = $"/k cd /d {adbDir}"; | |
p.Start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment