jordancoin/ios-skills-collection/dpearson2699-accessorysetupkit
Claude Code and agent skill by jordancoin/ios-skills-collection
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install jordancoin/ios-skills-collection/dpearson2699-accessorysetupkitSKILL.md
AccessorySetupKit
Privacy-preserving accessory discovery and setup for Bluetooth and Wi-Fi devices. Replaces broad Bluetooth/Wi-Fi permission prompts with a system-provided picker that grants per-accessory access with a single tap. Available iOS 18+ / Swift 6.3.
After setup, apps continue using CoreBluetooth and NetworkExtension for communication. AccessorySetupKit handles only the discovery and authorization step.
Contents
- Setup and Entitlements
- Discovery Descriptors
- Presenting the Picker
- Event Handling
- Bluetooth Accessories
- Wi-Fi Accessories
- Migration from CoreBluetooth
- Common Mistakes
- Review Checklist
- References
Setup and Entitlements
Info.plist Configuration
Add these keys to the app's Info.plist:
| Key | Type | Purpose | |
|---|---|---|---|
NSAccessorySetupSupports | [String] | Required. Array containing Bluetooth and/or WiFi | |
NSAccessorySetupBluetoothServices | [String] | Service UUIDs the app discovers (Bluetooth) | |
NSAccessorySetupBluetoothNames | [String] | Bluetooth names or substrings to match | |
NSAccessorySetupBluetoothCompanyIdentifiers | [Number] | Bluetooth company identifiers |
The Bluetooth-specific keys must match the values used in ASDiscoveryDescriptor. If the app uses identifiers, names, or services not declared in Info.plist, the app crashes at discovery time.
No Bluetooth Permission Required
When an app declares NSAccessorySetupSupports with Bluetooth, creating a CBCentralManager no longer triggers the system Bluetooth permission dialog. The central manager's state transitions to poweredOn only when the app has at least one paired accessory via AccessorySetupKit.
Discovery Descriptors
ASDiscoveryDescriptor defines the matching criteria for finding accessories. The system matches scanned results against all rules in the descriptor to filter for the target accessory.
Bluetooth Descriptor
A Bluetooth descriptor requires bluetoothCompanyIdentifier or bluetoothServiceUUID, plus at least one of:
bluetoothNameSubstringbluetoothManufacturerDataBlobandbluetoothManufacturerDataMask(same length)bluetoothServiceDataBlobandbluetoothServiceDataMask(same length)
Wi-Fi Descriptor
Supply either ssid or ssidPrefix, not both. The app crashes if both are set. The ssidPrefix must have a non-zero length.
Bluetooth Range
Control the physical proximity required for discovery:
| Value | Behavior | |
|---|---|---|
.default | Standard Bluetooth range | |
.immediate | Only accessories in close physical proximity |
Support Options
Set supportedOptions on the descriptor to declare the accessory's capabilities:
| Option | Purpose | |
|---|---|---|
.bluetoothPairingLE | BLE pairing support | |
.bluetoothTransportBridging | Bluetooth transport bridging | |
.bluetoothHID | Bluetooth HID device |
Presenting the Picker
Creating the Session
Create and activate an ASAccessorySession to manage discovery lifecycle:
Showing the Picker
Create ASPickerDisplayItem instances with a name, product image, and discovery descriptor, then pass them to the session:
The picker runs in a separate system process. It shows each matching device as a separate item. When multiple devices match a given descriptor, the picker creates a horizontal carousel.
Setup Options
Configure picker behavior per display item:
| Option | Effect | |
|---|---|---|
.rename | Allow renaming the accessory during setup | |
.confirmAuthorization | Show authorization confirmation before setup | |
.finishInApp | Signal that setup continues in the app after pairing |
Product Images
The picker displays images in a 180x120 point container. Best practices:
- Use high-resolution images for all screen scale factors
- Use transparent backgrounds for correct light/dark mode appearance
- Adjust transparent borders as padding to control apparent accessory size
- Test in both light and dark mode
Event Handling
Event Types
The session delivers ASAccessoryEvent objects through the event handler:
| Event | When | |
|---|---|---|
.activated | Session is active, query session.accessories | |
.accessoryAdded | User selected an accessory in the picker | |
.accessoryChanged | Accessory properties updated (e.g., renamed) | |
.accessoryRemoved | Accessory removed from system | |
.invalidated | Session invalidated, create a new one | |
.migrationComplete | Migration of legacy accessories completed | |
.pickerDidPresent | Picker appeared on screen | |
.pickerDidDismiss | Picker dismissed | |
.pickerSetupBridging | Transport bridging setup in progress | |
.pickerSetupPairing | Bluetooth pairing in progress | |
.pickerSetupFailed | Setup failed | |
.pickerSetupRename | User is renaming the accessory | |
.accessoryDiscovered | New accessory found (custom filtering mode) |
Coordinating Picker Dismissal
When the user selects an accessory, .accessoryAdded fires before .pickerDidDismiss. To show custom setup UI after the picker closes, store the accessory on the first event and act on it after dismissal:
Bluetooth Accessories
After an accessory is added via the picker, use CoreBluetooth to communicate. The bluetoothIdentifier on the ASAccessory maps to a CBPeripheral.
Key points:
CBCentralManagerstate reaches.poweredOnonly when the app has paired accessories- Scanning with
scanForPeripherals(withServices:)returns only
accessories paired through AccessorySetupKit
- No
NSBluetoothAlwaysUsageDescriptionis needed when using AccessorySetupKit
exclusively
Wi-Fi Accessories
For Wi-Fi accessories, the ssid on the ASAccessory identifies the network. Use NEHotspotConfiguration from NetworkExtension to join it:
Because the accessory was discovered through AccessorySetupKit, joining the network does not trigger the standard Wi-Fi access prompt.
Migration from CoreBluetooth
Apps with existing CoreBluetooth-authorized accessories can migrate them to AccessorySetupKit using ASMigrationDisplayItem. This is a one-time operation that registers known accessories in the new system.
Migration rules:
- If
showPickercontains only migration items, the system shows an
informational page instead of a discovery picker
- If migration items are mixed with regular display items, migration happens
only when a new accessory is discovered and set up
- Do not initialize
CBCentralManagerbefore migration completes — doing so
causes an error and the picker fails to appear
- The session receives
.migrationCompletewhen migration finishes
Common Mistakes
DON'T: Omit Info.plist keys for Bluetooth discovery
The app crashes if it uses identifiers, names, or services in descriptors that are not declared in Info.plist.
DON'T: Set both ssid and ssidPrefix
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dpearson2699--accessorysetupkit/SKILL.md
Popularity
- Repository stars
- 2
- 7-day trend score
- 5
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jordancoin/ios-skills-collection/dpearson2699-accessorysetupkit)