<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AccessoryAccess",
  "identifier" : "/documentation/AccessoryAccess/AAUSBAccessoryManager",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Accessory Access"
    ],
    "preciseIdentifier" : "c:objc(cs)AAUSBAccessoryManager"
  },
  "title" : "AAUSBAccessoryManager"
}
-->

# AAUSBAccessoryManager

A class your app uses to manage USB accessories and the listener objects for those accessories.

```
class AAUSBAccessoryManager
```

## Discussion

Don’t instantiate an `AAUSBAccessoryManager` directly, instead obtain the manager through the class property [`shared`](/documentation/AccessoryAccess/AAUSBAccessoryManager/shared).

Use the `AAUSBAccessoryManager` to manage accessories and register interest in events from USB accessories through [`AAUSBAccessoryListener`](/documentation/AccessoryAccess/AAUSBAccessoryListener) objects.  When a USB accessory connects to the system, the USB accessory manager notifies the listener and provides it an [`AAUSBAccessory`](/documentation/AccessoryAccess/AAUSBAccessory) object that represents this accessory. Your app can open this [`AAUSBAccessory`](/documentation/AccessoryAccess/AAUSBAccessory) object exclusively, and use it for performing USB transfers to the connected accessory.

A USB accessory listener receives notifications when a USB accessories connect to or disconnect from the system. These listeners can register or unregister with the USB accessory manager object. The accessory manager notifies your app about the USB accessories as long an accessory’s listener remains registered with the manager. The framework delivers all the notifications to the listener on the internal serial queue of the accessory manager.

The `AAUSBAccessoryManager` presents UI on behalf of your application, which means you can only use it from an application that implements a UI, that is, one that appears in the Dock.

> Note: To use the AccessoryAccess framework, add the `com.apple.developer.accessory-access.usb` entitlement to your app’s Xcode configuration. For more information, see <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.accessory-access.usb>.

## Topics

### Accessing the shared manager

[`class var shared: AAUSBAccessoryManager`](/documentation/AccessoryAccess/AAUSBAccessoryManager/shared)

Returns the shared USB accessory manager object for this process.

### Registering and unregistering listeners

[`func registerListener(any AAUSBAccessoryListener, matchingCriteria: [AAUSBAccessoryMatchingCriteria], completionHandler: ([AAUSBAccessory], (any Error)?) -> Void)`](/documentation/AccessoryAccess/AAUSBAccessoryManager/registerListener(_:matchingCriteria:completionHandler:))

Registers a USB accessory listener.

[`func unregisterListener(any AAUSBAccessoryListener, completionHandler: () -> Void)`](/documentation/AccessoryAccess/AAUSBAccessoryManager/unregisterListener(_:completionHandler:))

Unregister a previously registered listener.

### Finding events that apply to an accessory

[`func events(matching: [AAUSBAccessoryMatchingCriteria]) async throws -> some AsyncSequence<AAUSBAccessory.Event, Never>`](/documentation/AccessoryAccess/AAUSBAccessoryManager/events(matching:))

Returns an asynchronous list of events that match the provided criteria.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Sendable`](/documentation/Swift/Sendable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)