Skip to content

[msbuild] Improve interactive simulator selection by showing running simulators first. Fixes #25701#25772

Open
rolfbjarne wants to merge 9 commits into
mainfrom
dev/rolf/improve-interactive-simulator-selection
Open

[msbuild] Improve interactive simulator selection by showing running simulators first. Fixes #25701#25772
rolfbjarne wants to merge 9 commits into
mainfrom
dev/rolf/improve-interactive-simulator-selection

Conversation

@rolfbjarne

@rolfbjarne rolfbjarne commented Jun 22, 2026

Copy link
Copy Markdown
Member
  • Sort booted simulators first in GetAvailableDevices output so the interactive device selection (dotnet run/watch) shows running simulators at the top of the list.
  • Add Status metadata to device items (Booted/Shutdown for simulators, Paired for physical devices) matching the dotnet-run-for-maui spec.
  • Include OS version and state in the Description metadata for simulators so users can distinguish between devices running different OS versions and see which ones are already running (e.g., "iPhone 17 Pro - iOS 26.1 (Booted)" instead of just "iPhone 17 Pro").
  • Include OS version in the Description metadata for physical devices (e.g., "Rolf's iPhone 15 - iOS 26.1" instead of just "Rolf's iPhone 15").

It looks like this now:

Screenshot 2026-06-23 at 17 48 30

Fixes #25701

🤖 Pull request created by Copilot

… first

- Sort booted simulators first in GetAvailableDevices output so the
  interactive device selection (dotnet run/watch) shows running
  simulators at the top of the list.
- Add 'Status' metadata to device items (Booted/Shutdown for simulators,
  Paired for physical devices) matching the dotnet-run-for-maui spec.
- Include OS version in the Description metadata for all devices so
  users can distinguish between devices running different OS versions.

Fixes #25701

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Include the state (Booted/Shutdown) in the Description so it's visible
in the interactive device selection on the command line.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the GetAvailableDevices MSBuild task output to improve the interactive dotnet run/watch device selection experience by prioritizing running (booted) simulators and enriching device metadata to better distinguish similar devices.

Changes:

  • Sort available devices so Booted simulators appear first.
  • Enhance Description metadata to include OS versions and simulator state (Booted/Shutdown).
  • Emit Status metadata (Booted/Shutdown for simulators; derived from pairing state for physical devices) and add a regression test for booted-first ordering.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
msbuild/Xamarin.MacDev.Tasks/Tasks/GetAvailableDevices.cs Adds booted-first sorting and enriches per-device metadata (Description, Status) for devicectl + simctl results.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/GetAvailableDevicesTest.cs Updates expectations for richer Description strings and adds a test ensuring booted simulators are listed first.

Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/GetAvailableDevices.cs
rolfbjarne and others added 2 commits June 23, 2026 18:15
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne requested a review from mauroa as a code owner June 24, 2026 17:10
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

dalexsoto
dalexsoto previously approved these changes Jun 24, 2026
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 3 commits June 25, 2026 11:13
… pairing state

`devicectl list devices` only lists devices it already knows about (i.e.
paired devices), and may omit the `pairingState` field for such a device
(e.g. when `tunnelState` is `unavailable`). Default the Status metadata to
"Paired" in that case so these devices aren't reported with an empty status.

This fixes the DeviceCtl1 test, whose iPad test data has no `pairingState`
but is expected to report Status "Paired".

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…no pairing state

When `devicectl list devices` doesn't report a `pairingState` for a device,
default the Status metadata to "Unpaired" rather than leaving it empty, and
update the DeviceCtl1 test to expect "Unpaired" for the iPad test data (which
has no `pairingState`).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #0220b45] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 0220b455dfe900d24570337e83999ed0f59caf3d [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 0220b455dfe900d24570337e83999ed0f59caf3d [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #0220b45] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 0220b455dfe900d24570337e83999ed0f59caf3d [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #0220b45] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 0220b455dfe900d24570337e83999ed0f59caf3d [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #0220b45] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 199 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 17 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 0220b455dfe900d24570337e83999ed0f59caf3d [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve interactive simulator selection by showing running simulators first

4 participants