# audioaccessorykit

Guides automatic audio switching setup for third-party Bluetooth headphones with AudioAccessoryKit on iOS 26.4+. Useful when companion apps and extensions handle accessory state.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3000 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/audioaccessorykit/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/audioaccessorykit

## What it does

The skill explains how to implement Apple's AudioAccessoryKit framework, introduced in iOS 26.4 and iPadOS 26.4. It covers the workflow between a companion app and an app extension. The accessory pairs first via AccessorySetupKit to produce an `ASAccessory` instance. After pairing, the container app registers device capabilities with `AccessoryControlDevice.register`.

Ongoing updates happen from the app extension using a gated write workflow. Developers retrieve the active configuration via `AccessoryControlDevice.current(for:)`, mutate placement values like `.inEar` or `.offHead`, and call `update(_:)`. The skill also details reporting multi-device Bluetooth addresses using `Data`. It clarifies that AudioAccessoryKit is not meant for direct Bluetooth transport or standard `AVAudioSession` routing.

In the Xcode 26.6 toolchain, the framework is present in device SDKs but missing from the iPhone Simulator 26.5 SDK. Testing requires a physical device. To keep simulator builds working, isolate imports with `#if canImport(AudioAccessoryKit)` and stub the implementation.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill audioaccessorykit -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/audioaccessorykit/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/audioaccessorykit/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill audioaccessorykit -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/audioaccessorykit/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill audioaccessorykit -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/audioaccessorykit/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills audioaccessorykit
```

2. **Manually: put the files in place**
- File: `.github/skills/audioaccessorykit/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill audioaccessorykit -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/audioaccessorykit
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/audioaccessorykit/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill audioaccessorykit -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/audioaccessorykit/SKILL.md

## When to use it
- register a paired accessory with `AccessoryControlDevice` after AccessorySetupKit pairing
- report headphone placement changes from an app extension to the system
- configure Bluetooth source device identifiers for multi-point switching
- guard Xcode simulator builds using `#if canImport(AudioAccessoryKit)`

## Example prompts
- Show how to register an ASAccessory with .audioSwitching and .placement capabilities in AudioAccessoryKit.
- Write the app extension update flow for reporting .inEar placement changes.
- How do I handle AudioAccessoryKit missing from the iPhone Simulator 26.5 SDK?

## Similar
- [swiftdata-pro](https://affpapa.org/en/nevibecode/skills/swiftdata-pro.md) — skill · 9300 installs
- [cmux-architecture](https://affpapa.org/en/nevibecode/skills/cmux-architecture.md) — skill · 4900 installs
- [swiftui-patterns](https://affpapa.org/en/nevibecode/skills/affaan-m-swiftui-patterns.md) — skill · 4600 installs
- [swift-expert](https://affpapa.org/en/nevibecode/skills/swift-expert.md) — skill · 4100 installs
- [spm-build-analysis](https://affpapa.org/en/nevibecode/skills/spm-build-analysis.md) — skill · 3400 installs
- [xcode-compilation-analyzer](https://affpapa.org/en/nevibecode/skills/xcode-compilation-analyzer.md) — skill · 3400 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
