---
title: AAUSBAccessory
framework: accessoryaccess
role: symbol
role_heading: Class
path: accessoryaccess/aausbaccessory
---

# AAUSBAccessory

A class that represents a USB accessory.

## Declaration

```swift
class AAUSBAccessory
```

## Discussion

Discussion A USB accessory can either be obtained from the usbAccessoryDidConnect(_:) method, or instantiated from an XPC representation that describes an existing USB accessory.

## Topics

### Creating USB accessories

- [init(XPCRepresentation:)](accessoryaccess/aausbaccessory/init(xpcrepresentation:)-5lxcr.md)
- [init(xpcRepresentation:)](accessoryaccess/aausbaccessory/init(xpcrepresentation:)-6dmbu.md)
- [init(coder:)](accessoryaccess/aausbaccessory/init(coder:).md)

### Getting information about a USB accessory

- [configurationDescriptorData](accessoryaccess/aausbaccessory/configurationdescriptordata.md)
- [deviceDescriptorData](accessoryaccess/aausbaccessory/devicedescriptordata.md)
- [registryID](accessoryaccess/aausbaccessory/registryid.md)

### Managing a USB accessory

- [open(serviceQueue:completionHandler:)](accessoryaccess/aausbaccessory/open(servicequeue:completionhandler:).md)
- [close(completionHandler:)](accessoryaccess/aausbaccessory/close(completionhandler:).md)

### Connection and disconnection events

- [AAUSBAccessory.Event](accessoryaccess/aausbaccessory/event.md)

### Encoding a USB accessory for delivery to an XPC service

- [createXPCRepresentation()](accessoryaccess/aausbaccessory/createxpcrepresentation().md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Managing accessories

- [AAUSBAccessoryManager](accessoryaccess/aausbaccessorymanager.md)
