You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[xabt] Fix dotnet run failing with multiple AVDs present (#11001)
Fixes: #10998
When multiple AVD emulator images are defined but only one device is
running, 'dotnet run' incorrectly considers all AVDs (including
non-running ones) as available targets, causing a device selection
prompt or error in non-interactive mode.
Add FilterDevicesForSelection() to GetAvailableAndroidDevices that
filters the merged device list: when any online devices exist, only
online devices are returned (enabling auto-selection when a single
device is running). When no online devices exist, all devices are
returned including non-running emulators so the user can pick one
to boot.
## Address review: avoid allocation when no filtering needed
Two-pass approach in FilterDevicesForSelection: first determine if
filtering is needed, then allocate only when mixed online/offline
states exist. Returns the original list when all devices share the
same status.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/GetAvailableAndroidDevicesTests.cs
+100Lines changed: 100 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -706,6 +706,106 @@ public void MergeDevicesAndEmulators_NonRunningEmulatorHasFormattedDescription (
706
706
Assert.AreEqual("Pixel 7 Pro API 35 (Not Running)",result[0].GetMetadata("Description"),"Description should be formatted with (Not Running) suffix");
0 commit comments