Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
DeviceCapability
Declares a device capability required by a package. On Windows 10.0.10240.0, can contain up to 100 Device elements. On Windows 10.0.10586.0, can contain up to 1000 (for syntax and examples, see Examples).
Element hierarchy
<Package>
└─ <Capabilities>
└─ <DeviceCapability>
Syntax
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10">
...
<DeviceCapability
Name = 'A required value. <!-- TODO: Add description for t:ST_DeviceCapability -->' >
<!-- Child elements -->
Device{0,100}
AdditionalDeviceChoice{0,10000}
</DeviceCapability>
</Package>
Key
{} specific range of occurrences
Attributes
| Attribute | Description | Data type | Required | Default value |
|---|---|---|---|---|
| Name | The name of the device capability, either specified as a friendly name or a device interface class GUID. | A value. | Yes |
Child elements
| Child element | Description |
|---|---|
| Device | Declares a function for a device that is associated with the DeviceCapability. On Windows 10.0.10240.0, a DeviceCapability can contain up to 100 Device elements. On Windows 10.0.10586.0, it can contain up to 1000 (for more details, see DeviceCapability). |
Parent elements
| Parent element | Description |
|---|---|
| Capabilities | Declares the access to protected user resources that the package requires. |
Requirements
| Item | Value |
|---|---|
| Namespace | http://schemas.microsoft.com/appx/manifest/foundation/windows10 |
| Minimum OS Version |
Remarks
If the Name attribute is specified as a GUID, then it is validated as GUID.
Apps are granted access to some devices by default. To access other types of devices, you must specify them using a DeviceCapability element. Some device capabilities must be added to the package manifest manually. For more info, see How to specify device capabilities in a package manifest.
For more info about capability declarations, see App capability declarations.
The following device capabilities require child elements.
| Device capability | Description |
|---|---|
| usb | Provides access to APIs in the Windows.Devices.Usb namespace. This capability requires child elements. For more info, see Updating the app manifest package for a USB device. |
| humaninterfacedevice | Provides access to APIs in the Windows.Devices.HumanInterfaceDevice namespace. This capability requires child elements. For more info, see How to specify device capabilities for HID. |
| bluetooth.genericAttributeProfile | Provides access to APIs in the Windows.Devices.Bluetooth.GenericAttributeProfile namespace. This capability requires child elements. For more info, see How to specify device capabilities for Bluetooth. |
| bluetooth.rfcomm | Provides access to APIs in the Windows.Devices.Bluetooth.Rfcomm namespace. This capability requires child elements. For more info, see How to specify device capabilities for Bluetooth. |
Examples
Here's an example of a Capabilities node that will work on both Windows 10.0.10240.0 and 10.0.10586.0 (although, Windows 10.0.10240.0 will only parse the <Device> elements). Windows 10.0.10586.0, on the other hand, supports up to 100 <Device> elements plus <f2:Device> elements for a total complement of 1000.
<Package
xmlns:f2="http://schemas.microsoft.com/appx/manifest/foundation/windows10/2">
...
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10240.0" MaxVersionTested="10.0.10586.0"/>
</Dependencies>
...
<Capabilities>
<DeviceCapability Name="microphone"/>
<DeviceCapability Name="webcam"/>
<DeviceCapability Name="<name>">
<Device Id="id_000" ... />
...
<Device Id="id_099" ... />
<f2:Device Id="id_100" ... />
...
<f2:Device Id="id_999" ... />
</DeviceCapability>
</Capabilities>
If you only want to support Windows 10.0.10240.0, then you only need the <Device> element. If you only want to support Windows 10.0.10586.0, then you only need the <f2:Device> element.
For more examples, see How to specify device capabilities in a package manifest.
See also
Feedback
Was this page helpful?
