How do i use accessory tracking
Asked on 06/11/2025
1 search
To use accessory tracking, you can leverage the APIs provided by Apple for spatial accessory input, particularly on visionOS. Here's a brief overview of how you can implement accessory tracking:
-
Setup in Xcode: Start by setting up your Xcode project to support spatial accessories. You can do this by adding spatial game controller support to your app's plist via the Xcode capabilities editor.
-
Connect to Accessories: Use the Game Controller framework to manage connections with spatial accessories. This involves discovering connections, listening to connection and disconnection events, and iterating over current connections.
-
Track Accessories: Use ARKit and RealityKit to track spatial accessories. You can create an accessory tracking provider to track accessory objects and handle connection changes by rerunning the ARKit session with the updated configuration.
-
Anchor Virtual Content: Use RealityKit to create anchor entities that attach virtual content to the physical world. This allows you to anchor virtual content to your accessory and interact with other elements in your RealityKit scene.
-
Handle Accessory Movements: Implement accessory anchors to track the relative motion and rotational movement of accessories in space. You can choose between predicted tracking mode for low latency interactions or continuous tracking mode for higher accuracy.
For more detailed implementation, you can refer to the session "Explore spatial accessory input on visionOS" from WWDC 2025. You can start by watching the section on Track accessories with ARKit (13:37).
If you have specific questions about accessory tracking or need further details, feel free to ask!

Explore spatial accessory input on visionOS
Learn how you can integrate spatial accessories into your app. Display virtual content, interact with your app, track them in space, and get information on interactions for enhanced virtual experiences on visionOS.

What’s new in DockKit
Discover how intelligent tracking in DockKit allows for smoother transitions between subjects. We will cover what intelligent tracking is, how it uses an ML model to select and track subjects, and how you can use it in your app.

Meet AccessorySetupKit
Elevate your accessory setup experience with AccessorySetupKit. Display a beautiful pairing dialog with an image of your Bluetooth or Wi-Fi accessory — no trip to the Settings app required. Discover how to improve privacy by pairing only your app with an accessory. And learn how you can migrate existing accessories so they can be managed by AccessorySetupKit.