# AddiOSDevice

- Module: [Aspire.Hosting.Maui](/reference/api/go/aspire.hosting.maui.md)
- Version: `17.0.0-preview.1.26567.5`
- Kind: `method`
- Defined on: [`MauiProjectResource`](/reference/api/go/aspire.hosting.maui/mauiprojectresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Adds an iOS physical device resource to run the MAUI application on an iOS device with a specific name and device UDID.

## Remarks

This method creates a new iOS device platform resource that will run the MAUI application
targeting the iOS platform using `dotnet run`. The resource does not auto-start
and must be explicitly started from the dashboard by clicking the start button.
Multiple iOS device resources can be added to the same MAUI project if needed, each with
a unique name.
This will run the application on a physical iOS device connected via USB.
The device must be provisioned before deployment. For more information, see
https://learn.microsoft.com/dotnet/maui/ios/device-provisioning
To target a specific device when multiple are connected, provide the device UDID.
You can find the device UDID in Xcode under Window > Devices and Simulators > Devices tab,
or right-click on the device and select "Copy Identifier".

## Definition

```go
func (MauiProjectResource) AddiOSDevice(
    name string,
    options ...*AddiOSDeviceOptions,
) MauiiOSDeviceResource
```

## Parameters

- `name` (`string`) -- The name of the iOS device resource.
- `options` (`...*AddiOSDeviceOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*AddiOSDeviceOptions` argument.

- `DeviceId` (`*string`) -- Optional device UDID to target a specific iOS device. If not specified, uses the only attached device (requires exactly one device to be connected).

## Returns

[`MauiiOSDeviceResource`](/reference/api/go/aspire.hosting.maui/mauiiosdeviceresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`MauiProjectResource`](/reference/api/go/aspire.hosting.maui/mauiprojectresource.md)
