# MauiProjectResource.AddAndroidDevice

- Module: [Aspire.Hosting.Maui](/reference/api/go/aspire.hosting.maui.md)
- Defined on: [MauiProjectResource](/reference/api/go/aspire.hosting.maui/mauiprojectresource.md)
- Version: `17.0.0-preview.1.26567.5`
- Kind: `method`

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

## Remarks

This method creates a new Android device platform resource that will run the MAUI application
targeting the Android platform using `dotnet run`. The resource does not auto-start
and must be explicitly started from the dashboard by clicking the start button.
Multiple Android 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 Android device connected via USB/WiFi debugging.
Make sure an Android device is connected and visible via `adb devices`.
To target a specific device when multiple are attached, provide the device ID (e.g., "abc12345" or "192.168.1.100:5555" for WiFi debugging).
Use `adb devices` to list available device IDs.

## Definition

```go
type MauiProjectResource interface {
    // ... omitted for brevity
    AddAndroidDevice(
        name string,
        options ...*AddAndroidDeviceOptions,
    ) MauiAndroidDeviceResource
}
```

## Signature

```go
AddAndroidDevice(
    name string,
    options ...*AddAndroidDeviceOptions,
) MauiAndroidDeviceResource
```

## Parameters

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

## Options

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

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

## Returns

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

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

## Defined on

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