Repository navigation
Migrate debugging tasks off legacy Android tooling - #12916
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved critical SDK ADB path initialization and moderate ABI, user-profile, and performance issues remain.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (3)
What changed in this PR
Migrates debugging tasks from legacy Android tooling to in-tree SDK tooling and removes obsolete GDB support.
Changes:
- Adds SDK-based ADB execution, device metadata, ABI lookup, and app detection.
- Updates device selection, FastDeploy, and debugging targets.
- Removes legacy references and obsolete GDB tasks while retaining compatibility wiring.
| File | Summary |
|---|---|
tests/Xamarin.Android.Tools.AndroidSdk-Tests/AdbRunnerTests.cs |
Tests ADB metadata parsing. |
src/Xamarin.Android.Tools.AndroidSdk/Runners/AdbRunner.cs |
Adds shell execution and metadata support. |
src/Xamarin.Android.Tools.AndroidSdk/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt |
Records new APIs. |
src/Xamarin.Android.Tools.AndroidSdk/PublicAPI/net11.0/PublicAPI.Unshipped.txt |
Records new APIs. |
src/Xamarin.Android.Tools.AndroidSdk/PublicAPI/net10.0/PublicAPI.Unshipped.txt |
Records new APIs. |
src/Xamarin.Android.Tools.AndroidSdk/Models/AdbDeviceInfo.cs |
Adds cached device metadata. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs |
Tests device selection behavior. |
src/Xamarin.Android.Build.Debugging.Tasks/Xamarin.Android.Common.Debugging.targets |
Updates debugging targets and removes GDB targets. |
src/Xamarin.Android.Build.Debugging.Tasks/Xamarin.Android.Common.Debugging.props |
Removes obsolete GDB properties. |
src/Xamarin.Android.Build.Debugging.Tasks/Xamarin.Android.Build.Debugging.Tasks.csproj |
Removes legacy project references. |
src/Xamarin.Android.Build.Debugging.Tasks/Utilities/AndroidHelper.cs |
Implements SDK-based device selection. |
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/WaitForAppDetection.cs |
Updates asynchronous detection handling. |
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/RunTests.cs |
Updates tooling namespaces. |
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/ResolveXamarinAndroidTools.cs |
Removes obsolete resolver functionality. |
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/GetPrimaryCpuAbi.cs |
Uses SDK ADB APIs for ABI detection. |
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/GetGdbSymbols.cs |
Removes obsolete GDB symbol handling. |
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/GenerateGdbEnvironment.cs |
Removes obsolete GDB environment handling. |
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/FastDeploy.cs |
Uses SDK-based ADB resolution. |
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/DetectIfAppWasUninstalled.cs |
Uses SDK-based package detection. |
Use the Android SDK adb runner for device selection and package queries, preserve the resolver target for MSBuild callers, and remove Mono-specific tasks. Stack this change on the unified run-target branch. Co-authored-by: Copilot App <[email protected]>
Remove the unused GDB setup chain, its environment generation task, and associated defaults now that GetGdbSymbols is gone. Co-authored-by: Copilot App <[email protected]>
Resolve the SDK adb executable before early ABI detection, avoid unused emulator name probes during device selection, and exercise package-query success and failure with portable fake adb tests. Co-authored-by: Copilot App <[email protected]>
1328c3d to
6502cfa
Compare
Preserve Android SDK device selection alongside the newly added supported-ABI cache and runtime-identifier fallback, retaining the removal of obsolete GDB targets. Co-authored-by: Copilot App <[email protected]>
MSBuild app builds complete, but an adb server can inherit redirected stdout and stderr. The test builder and adb helper previously waited for stream EOF forever after the parent exited, causing all Windows test lanes to hit their three-hour Azure task limit. Bound stream draining and kill timed-out child processes; cover inherited output handles with a Windows regression test. Co-authored-by: Copilot App <[email protected]>
ADB may launch a long-lived server while MSBuild is building from a temporary test project. On Windows the server can retain the child's inherited working directory and prevent BuildBasicApplicationThenMoveIt and Check9PatchFilesAreProcessed from moving or deleting it. Start all AdbRunner and FastDeploy adb processes in the stable system temp directory; resolve relative tool paths before switching the working directory. Cover device listing and shell commands with a cross-platform working-directory regression test. Co-authored-by: Copilot App <[email protected]>
|
/review |
|
✅ Android PR Reviewer completed successfully! Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "azcliprod.blob.core.windows.net"See Network Configuration for more information.
|
There was a problem hiding this comment.
⚠️ Needs Changes
Findings: 1 ❌ error · 0
The new working-directory regression test compares lexical and physical temp paths, which are commonly /var/... and /private/var/... on macOS. That makes the test fail even when AdbRunner uses the intended directory; the currently red Android Tools macOS check is consistent with this defect. The remaining Azure matrix was still running at review time.
The production migration otherwise preserves the legacy device-selection and ABI fallback behavior well, avoids unnecessary emulator-name queries, and centralizes the stable ADB working directory cleanly.
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
azcliprod.blob.core.windows.net
To allow these domains, add them to the network.allowed list in your workflow frontmatter:
network:
allowed:
- defaults
- "azcliprod.blob.core.windows.net"See Network Configuration for more information.
Generated by Android PR Reviewer for #12916 · copilot · gpt56 · 231.5 AIC · ⌖ 17.5 AIC · ⊞ 26K
Comment /review to run again
The macOS fake-adb test printed a physical /private/var path while Path.GetTempPath returned its /var alias. Use a unique relative marker created by each adb command and assert it appears under the temp directory, so the test checks directory identity without depending on spelling. Co-authored-by: Copilot App <[email protected]>
## Summary - Remove the `Mono.AndroidTools` and `Xamarin.AndroidTools` projects and their compiled assemblies from the workload SDK pack. - Migrate installer SDK/JDK discovery and macOS directory-size process execution to `Xamarin.Android.Tools.AndroidSdk`, preserving first-time installation when the SDK or JDK is absent. - Remove obsolete solution, build, packaging, and localization references; add installer discovery regression coverage. **Breaking change:** Tools referencing `Mono.AndroidTools.dll` or `Xamarin.AndroidTools.dll` directly must migrate to the supported shared Android SDK tooling APIs. Generated non-English `.resx` files under `src/Xamarin.AndroidTools/Properties/` remain untouched per repository localization policy; they are not compiled or packaged. Stacked on #12916 (which follows merged #12906). Co-authored-by: Copilot App <[email protected]>



Summary
Xamarin.AndroidToolsandMono.AndroidTools.GetGdbSymbols,ResolveXamarinAndroidTools, and obsolete GDB debugging targets; retain_ResolveXamarinAndroidToolsas a compatibility target for existing MSBuild dependencies.RunActivity.Validation
AdbRunnerTests: 112 passed, 7 platform-specific skipped.Full-build host/device tests require the local Android SDK build, unavailable in this worktree. An earlier unfiltered SDK tooling test run had an unrelated JDK-installer extraction access-denied failure under
D:\temp.Stacked on #12906.