From 8ac105db0a033070df713b288b6102134de20ace Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 17 Apr 2026 19:46:44 +0200 Subject: [PATCH 1/2] Update docs for the latest macios workloads (for Xcode 26.3). --- docs/ios/building-apps/build-properties.md | 16 ++++++++++- docs/ios/building-apps/build-targets.md | 32 ++++++++++++++++++++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/docs/ios/building-apps/build-properties.md b/docs/ios/building-apps/build-properties.md index 08f9a27..0d73cc9 100644 --- a/docs/ios/building-apps/build-properties.md +++ b/docs/ios/building-apps/build-properties.md @@ -344,6 +344,20 @@ Only applicable to macOS and Mac Catalyst projects. See [BuildIpa](#buildipa) for iOS and tvOS projects. +## Device + +Specifies which mobile device or emulator to target when using `dotnet run +--device ` or MSBuild targets that interact with devices (such as +`Run`, `Install`, or `Uninstall`). + +The value can be anything the command-line tools `simctl` or `devicectl` +accept for the device name; this is typically either the UDID or the name of +the device. For example, for the device `My iOS Device` with UDID `0000-aaaabbbb`, use +either `-p:Device="My iOS Device"` or `-p:Device=0000-aaaabbbb`. + +For more information about device selection, see the +[.NET SDK device selection specification](https://github.com/dotnet/sdk/blob/2b9fc02a265c735f2132e4e3626e94962e48bdf5/documentation/specs/dotnet-run-for-maui.md). + ## DeviceSpecificBuild If the build should be specific to the selected device. @@ -1169,7 +1183,7 @@ This will pass `-W` to `open` if set to `true`. Example: ```shell -$ dotnet run -p:OpenWaitForExit=true +$ dotnet run -p:OpenWaitForExit=false ``` ### OpenArguments diff --git a/docs/ios/building-apps/build-targets.md b/docs/ios/building-apps/build-targets.md index fb548e6..86a0ff2 100644 --- a/docs/ios/building-apps/build-targets.md +++ b/docs/ios/building-apps/build-targets.md @@ -16,11 +16,39 @@ Builds the source code within a project and all dependencies. Removes all files generated by the build process. +## ComputeAvailableDevices + +Queries and returns a list of available iOS or tvOS devices and simulators that can be used with `dotnet run`. + +This target is called automatically by the .NET SDK's `dotnet run` command to +support device selection via the `--device` option. It returns a `@(Devices)` +item group where each device has the following metadata: + +- **Description**: The name of the device (e.g., "iPhone 16 - iOS 26.0" for simulators, "My iPhone 16" for physical devices) +- **Type**: Either "Device" or "Simulator" +- **OSVersion**: The OS version of the device +- **UDID**: The UDID of the device +- **RuntimeIdentifier**: The RuntimeIdentifier of the device + +For example, to list all available devices: + +```shell +$ dotnet build -t:ComputeAvailableDevices +``` + +This target is part of the [.NET SDK device selection specification](https://github.com/dotnet/sdk/blob/2b9fc02a265c735f2132e4e3626e94962e48bdf5/documentation/specs/dotnet-run-for-maui.md) and enables commands like: + +```shell +$ dotnet run --device UDID +``` + +Added in .NET 11. + ## Run Builds the source code within a project and all dependencies, and then deploys and runs it -on a default simulator/device. A specific deployment target can be set by using the `$(_DeviceName)` property. +on a default simulator/device. A specific deployment target can be set by using the `$(Device)` property. ```dotnetcli -dotnet build -t:Run project.csproj -p:_DeviceName=$(MY_DEVICE_UDID) +dotnet build -t:Run project.csproj -p:Device=$(MY_DEVICE_UDID) ``` From 359ab03115f352aefa2d70d88a6bc8abc6f8fa02 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 20 Apr 2026 09:25:45 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/ios/building-apps/build-properties.md | 6 ++---- docs/ios/building-apps/build-targets.md | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/ios/building-apps/build-properties.md b/docs/ios/building-apps/build-properties.md index 0d73cc9..b456f6a 100644 --- a/docs/ios/building-apps/build-properties.md +++ b/docs/ios/building-apps/build-properties.md @@ -346,9 +346,7 @@ See [BuildIpa](#buildipa) for iOS and tvOS projects. ## Device -Specifies which mobile device or emulator to target when using `dotnet run ---device ` or MSBuild targets that interact with devices (such as -`Run`, `Install`, or `Uninstall`). +Specifies which mobile device or simulator to target when using `dotnet run --device ` or MSBuild targets that interact with devices (such as `Run`, `Install`, or `Uninstall`). The value can be anything the command-line tools `simctl` or `devicectl` accept for the device name; this is typically either the UDID or the name of @@ -1183,7 +1181,7 @@ This will pass `-W` to `open` if set to `true`. Example: ```shell -$ dotnet run -p:OpenWaitForExit=false +$ dotnet run -p:OpenWaitForExit=true ``` ### OpenArguments diff --git a/docs/ios/building-apps/build-targets.md b/docs/ios/building-apps/build-targets.md index 86a0ff2..fbf0abf 100644 --- a/docs/ios/building-apps/build-targets.md +++ b/docs/ios/building-apps/build-targets.md @@ -47,8 +47,8 @@ Added in .NET 11. ## Run Builds the source code within a project and all dependencies, and then deploys and runs it -on a default simulator/device. A specific deployment target can be set by using the `$(Device)` property. +on a default simulator/device. A specific deployment target can be set by using the `$(Device)` property. ```dotnetcli -dotnet build -t:Run project.csproj -p:Device=$(MY_DEVICE_UDID) +dotnet build -t:Run project.csproj -p:Device= ```