Back to Skills

accessorysetupkit

Discover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery descriptors for BLE or Wi-Fi devices, handling accessory session events, migrating from CoreBluetooth permission-based scanning, or setting up accessories without requiring broad Bluetooth permissions.

857stars43forksUpdated 7/9/2026

Security Assessment

Safe(100/100)
Security Score100/100

About accessorysetupkit

Guidance for adopting AccessorySetupKit, Apple's privacy-preserving discovery and setup layer for Bluetooth and Wi-Fi accessories on iOS 18+ / Swift 6.3. Instead of broad Bluetooth or Wi-Fi permission prompts, it presents a system-provided picker that grants per-accessory access with a single tap; after setup, apps continue communicating through CoreBluetooth or NetworkExtension, with AccessorySetupKit handling only discovery and authorization.

Setup begins with Info.plist keys: NSAccessorySetupSupports listing Bluetooth and/or WiFi, plus Bluetooth-specific keys for service UUIDs, names or substrings, and two-byte company identifiers. These must match the discovery descriptor or the app crashes during discovery. A notable benefit is that once NSAccessorySetupSupports declares Bluetooth, creating a CBCentralManager no longer triggers the system permission dialog, and central state reaches poweredOn only when at least one accessory is paired.

ASDiscoveryDescriptor defines matching criteria. Bluetooth descriptors need at least a company identifier or service UUID, with optional narrower matchers (name substring, manufacturer or service data blob plus an equal-length mask) and a bluetoothRange of default or immediate. Wi-Fi descriptors take either ssid or ssidPrefix but never both, and supportedOptions declare capabilities such as bluetoothPairingLE, bluetoothTransportBridging, or bluetoothHID.

Discovery is driven by ASAccessorySession: activate it, wait for the activated event before reading session.accessories or showing the picker, then handle events like accessoryAdded, accessoryChanged, accessoryRemoved, invalidated, migrationComplete, and picker presentation events. The picker is populated with ASPickerDisplayItem instances (name, product image, descriptor), runs in a separate system process, and shows multiple matches as a carousel. Per-item setupOptions (rename, confirmAuthorization, finishInApp), product-image best practices for the 180x120 point container, and migration from CoreBluetooth permission-based scanning round out the coverage.

FAQ

Does using AccessorySetupKit still require Bluetooth permission?

No. Once NSAccessorySetupSupports declares Bluetooth, creating a CBCentralManager no longer triggers the system permission dialog; the picker grants per-accessory access instead.

What is the minimum a Bluetooth discovery descriptor needs?

At least one of bluetoothCompanyIdentifier or bluetoothServiceUUID, with optional narrower matchers like a name substring or a manufacturer/service data blob and an equal-length mask.

Can I set both ssid and ssidPrefix on a Wi-Fi descriptor?

No. Supply either ssid or ssidPrefix but not both, or the app crashes; ssidPrefix must also have non-zero length.

When can I read session.accessories or show the picker?

Only after the session delivers the activated event; activate ASAccessorySession first and wait for that event.

What happens after an accessory is set up?

AccessorySetupKit handles only discovery and authorization; the app then communicates using CoreBluetooth for Bluetooth or NetworkExtension for Wi-Fi.

All Files

3 files
references/accessorysetupkit-patterns.md18.3 KB
View
evals/evals.json4.2 KB
View
SKILL.md16.0 KB
View

Install accessorysetupkit

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill