From c85f725547f5be4efa19a499e487d8b8fccf0416 Mon Sep 17 00:00:00 2001 From: Stephane Delcroix Date: Mon, 16 Jun 2025 10:42:31 +0200 Subject: [PATCH 1/4] detect ANDROID_SDK_ROOT --- NuGet.config | 2 ++ src/Tools/dotnet-dsrouter/ADBTcpRouterFactory.cs | 4 +++- src/Tools/dotnet-dsrouter/dotnet-dsrouter.csproj | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index d060e04ff3..02768ab104 100644 --- a/NuGet.config +++ b/NuGet.config @@ -20,6 +20,8 @@ + + diff --git a/src/Tools/dotnet-dsrouter/ADBTcpRouterFactory.cs b/src/Tools/dotnet-dsrouter/ADBTcpRouterFactory.cs index 4cb9284ead..2ca4fbb0a8 100644 --- a/src/Tools/dotnet-dsrouter/ADBTcpRouterFactory.cs +++ b/src/Tools/dotnet-dsrouter/ADBTcpRouterFactory.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using Microsoft.Diagnostics.NETCore.Client; using Microsoft.Extensions.Logging; +using Xamarin.Android.Tools; namespace Microsoft.Diagnostics.Tools.DiagnosticsServerRouter { @@ -65,7 +66,8 @@ public static void AdbRemovePortReverse(int localPort, int remotePort, bool owns public static bool RunAdbCommandInternal(string command, string expectedOutput, int expectedExitCode, bool rethrow, ILogger logger) { - string sdkRoot = Environment.GetEnvironmentVariable("ANDROID_SDK_ROOT"); + //ANDROID_SDK_ROOT is deprecated + string sdkRoot = Environment.GetEnvironmentVariable("ANDROID_HOME") ?? Environment.GetEnvironmentVariable("ANDROID_SDK_ROOT") ?? new AndroidSdkInfo().AndroidSdkPath; string adbTool = "adb"; if (!string.IsNullOrEmpty(sdkRoot)) diff --git a/src/Tools/dotnet-dsrouter/dotnet-dsrouter.csproj b/src/Tools/dotnet-dsrouter/dotnet-dsrouter.csproj index 939c3601da..be672b50e1 100644 --- a/src/Tools/dotnet-dsrouter/dotnet-dsrouter.csproj +++ b/src/Tools/dotnet-dsrouter/dotnet-dsrouter.csproj @@ -26,6 +26,7 @@ + From c392e451acb248d4a571dc7d3add431271601583 Mon Sep 17 00:00:00 2001 From: Stephane Delcroix Date: Mon, 16 Jun 2025 17:09:04 +0200 Subject: [PATCH 2/4] only log what's requested by the user --- .../dotnet-dsrouter/ADBTcpRouterFactory.cs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Tools/dotnet-dsrouter/ADBTcpRouterFactory.cs b/src/Tools/dotnet-dsrouter/ADBTcpRouterFactory.cs index 2ca4fbb0a8..856ce7baa8 100644 --- a/src/Tools/dotnet-dsrouter/ADBTcpRouterFactory.cs +++ b/src/Tools/dotnet-dsrouter/ADBTcpRouterFactory.cs @@ -66,8 +66,27 @@ public static void AdbRemovePortReverse(int localPort, int remotePort, bool owns public static bool RunAdbCommandInternal(string command, string expectedOutput, int expectedExitCode, bool rethrow, ILogger logger) { + void sdklogger(TraceLevel level, string message) + { + switch (level) + { + case TraceLevel.Error: + logger?.LogError(message); + break; + case TraceLevel.Warning: + logger?.LogWarning(message); + break; + case TraceLevel.Info: + logger?.LogInformation(message); + break; + case TraceLevel.Verbose: + logger?.LogDebug(message); + break; + } + }; + //ANDROID_SDK_ROOT is deprecated - string sdkRoot = Environment.GetEnvironmentVariable("ANDROID_HOME") ?? Environment.GetEnvironmentVariable("ANDROID_SDK_ROOT") ?? new AndroidSdkInfo().AndroidSdkPath; + string sdkRoot = Environment.GetEnvironmentVariable("ANDROID_HOME") ?? Environment.GetEnvironmentVariable("ANDROID_SDK_ROOT") ?? new AndroidSdkInfo(logger: sdklogger).AndroidSdkPath; string adbTool = "adb"; if (!string.IsNullOrEmpty(sdkRoot)) From 5751bac7973da22343d695c2f061483b8aeb2627 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Wed, 23 Jul 2025 21:10:25 -0500 Subject: [PATCH 3/4] Track Xamarin.Android.Tools.AndroidSdk with Maestro --- NuGet.config | 2 -- eng/Version.Details.xml | 4 ++++ eng/Versions.props | 1 + src/Tools/dotnet-dsrouter/dotnet-dsrouter.csproj | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/NuGet.config b/NuGet.config index 02768ab104..d060e04ff3 100644 --- a/NuGet.config +++ b/NuGet.config @@ -20,8 +20,6 @@ - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 260c35a22a..24dddd69c8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -9,6 +9,10 @@ https://github.com/microsoft/clrmd d724947392626b66e39b525998a8817447d50380 + + https://github.com/dotnet/android + bf304cf475308547a2a1a342bb9f2e6825cc33cd + diff --git a/eng/Versions.props b/eng/Versions.props index 8e96ea5ed8..e01e55b9a4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -72,6 +72,7 @@ 10.0.26100.1 13.0.1 10.0.622304 + 1.0.105-preview.225