[msbuild] Fix listing devices with no udid. Fixes #24605.#24607
[msbuild] Fix listing devices with no udid. Fixes #24605.#24607rolfbjarne merged 2 commits intomainfrom
Conversation
In some cases, `devicectl` may list a device with no udid, so handle this by using the 'identifier' value as the udid. Fixes this problem: ``` error MSB4028: The "GetAvailableDevices" task's outputs could not be retrieved from the "DiscardedDevices" parameter. Parameter "includeEscaped" cannot have zero length. ``` Fixes #24605.
There was a problem hiding this comment.
Pull request overview
Updates the GetAvailableDevices MSBuild task to handle devicectl output where a device may be listed without a UDID, preventing MSBuild from failing when producing discarded-device outputs (Fixes #24605).
Changes:
- Fall back to
identifierwhenhardwareProperties.udidis missing indevicectlJSON output. - Add a regression test covering a
macdevice entry with noudid, ensuring it’s handled and discarded correctly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
msbuild/Xamarin.MacDev.Tasks/Tasks/GetAvailableDevices.cs |
Adds identifier fallback logic for missing UDIDs when parsing devicectl output (and introduces file-based overrides for ctl output). |
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/GetAvailableDevicesTest.cs |
Adds a new test JSON sample and test case for a device entry missing udid. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #f6fa34e] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #f6fa34e] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [CI Build #f6fa34e] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [CI Build #f6fa34e] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #f6fa34e] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #f6fa34e] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #f6fa34e] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💻 [CI Build #f6fa34e] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
🚀 [CI Build #f6fa34e] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 117 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Fixes #24605. (#24616) In some cases, `devicectl` may list a device with no udid, so handle this by using the 'identifier' value as the udid. Fixes this problem: ``` error MSB4028: The "GetAvailableDevices" task's outputs could not be retrieved from the "DiscardedDevices" parameter. Parameter "includeEscaped" cannot have zero length. ``` Fixes #24605. Backport of #24607.
In some cases,
devicectlmay list a device with no udid, so handle this byusing the 'identifier' value as the udid.
Fixes this problem:
Fixes #24605.