
Audioaccessorykit
Support automatic audio switching for paired third-party Bluetooth headphones or...
Install
npx skills add dpearson2699/swift-ios-skills --skill audioaccessorykit -g -a claude-code -y- Repository
- dpearson2699/swift-ios-skills1.3k
- Category
- Media
- Updated
- 3mo ago
- License
- See repository
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Support automatic audio switching for paired third-party Bluetooth headphones or earbuds with AudioAccessoryKit. Use when a companion app registers an audio accessory, an app extension reports worn/removed placement or connected source-device changes, or AccessoryControlDevice capabilities and errors need handling. Do not use for general AVAudioSession routing, Bluetooth transport, or initial accessory pairing.
AudioAccessoryKit
Automatic audio switching support and intelligent audio routing inputs for third-party audio accessories. Enables companion apps to register audio accessory configuration with the system, and app extensions to report placement and connected source changes that help the system switch audio output. Available iOS 26.4+ / iPadOS 26.4+.
Beta-sensitive. AudioAccessoryKit is new in iOS 26.4. Re-check current Apple documentation before relying on specific API details.
AudioAccessoryKit builds on top of AccessorySetupKit. The accessory must first
be paired via AccessorySetupKit before it can be registered for audio features.
The central type is AccessoryControlDevice, which registers a
Configuration from the container app and applies ongoing configuration updates
from the app extension.
Contents
- Setup
- Session Management
- Audio Switching
- Device Placement
- Connected Audio Sources
- Feature Discovery
- Error Handling
- Common Mistakes
- Review Checklist
- References
Setup
Prerequisites
- Pair the accessory over Bluetooth using AccessorySetupKit. This yields an
ASAccessoryobject. - Import the frameworks where needed in the container app and extension:
import AccessorySetupKit
import AudioAccessoryKit
Framework Availability
| Platform | Minimum Version |
|---|---|
| iOS | 26.4+ |
| iPadOS | 26.4+ |
In the current Xcode 26.6 toolchain, AudioAccessoryKit is present in the device
SDK but not the iPhone Simulator 26.5 SDK. Use a physical-device destination
for this target. If the rest of the app must build for Simulator, isolate target
membership or guard the import and implementation with
#if canImport(AudioAccessoryKit) and provide a simulator stub.


