---
title: "device(forUID:)"
framework: Core Audio
role: symbol
role_heading: Instance Method
platforms: [macOS 15.0+]
path: "coreaudio/audiohardwareplugin/device(foruid:)"
---

# device(forUID:)

## Declaration

```swift
func device(forUID UID: String) throws -> AudioHardwareDevice?
```

## Parameters

- `UID`: A String representing the UID of the device object.

## Return Value

Return Value The AudioHardwareDevice that corresponds with the given UID, or nil if the UID does not correspond with any device object.
