ARKit visionOS Developer
Description and Goals
This skill provides comprehensive guidance for implementing ARKit-powered features on visionOS. ARKit on visionOS uses ARKitSession with data providers to access world tracking, hand tracking, plane detection, scene reconstruction, and other spatial data, which can then be bridged into RealityKit content.
Goals
- Enable developers to set up and manage ARKitSession on visionOS
- Guide proper authorization handling for ARKit data providers
- Help developers choose and configure appropriate data providers
- Support anchor processing and RealityKit integration
- Ensure proper lifecycle management of ARKit sessions
What This Skill Should Do
When implementing ARKit features on visionOS, this skill should:
- Guide ARKitSession setup - Help you create and manage long-lived ARKitSession instances
- Handle authorization - Show how to request and check authorization for required data types
- Select data providers - Help you choose the right providers (world tracking, hand tracking, plane detection, etc.)
- Process anchors - Demonstrate how to consume anchor updates and map them to RealityKit entities
- Manage lifecycle - Ensure proper session start/stop and task cancellation
- Bridge to RealityKit - Show how to integrate ARKit anchors with RealityKit content
Load the appropriate reference file from the tables below for detailed usage, code examples, and best practices.
Quick Start Workflow
- Add
NSWorldSensingUsageDescription, NSHandsTrackingUsageDescription, and NSMainCameraUsageDescription to Info.plist as needed for the providers you use.
- Use the presentation style required by the selected providers. Some providers require immersive space, while others have more specific rules.
- Create a long-lived
ARKitSession and the data providers you need.
- Request authorization for provider-required data types before running the session.
- Run the session with your providers and observe
anchorUpdates streams.
- Map anchors to RealityKit entities and keep state in a model layer.
- Observe
ARKitSession.events for authorization changes and errors.
- Stop the session and cancel tasks when leaving the immersive space.
Information About the Skill
Core Concepts
ARKitSession Lifecycle
- Keep a strong reference to the session; call
run(_:) with providers, stop on teardown.
- Sessions stop automatically on deinit, so maintain references throughout the immersive experience.
Authorization
- Use
requestAuthorization(for:) or queryAuthorization(for:) and handle denied states gracefully.
- Request authorization before running the session with providers that require it.
Data Providers
- Choose providers for world tracking, plane detection, scene reconstruction, and hand tracking based on the feature set.
- Providers expose
anchorUpdates streams that you consume to process anchors.
Anchors and Updates
- Consume provider
anchorUpdates and reconcile added, updated, and removed anchors.
- Normalize anchor IDs to your own state model for reliable entity updates.
RealityKit Bridge
- Use
ARKitAnchorComponent to inspect backing ARKit data on entities when needed.
- Treat ARKit streams as authoritative and keep rendering logic in RealityKit.
Implementation Patterns
- Prefer one session per immersive experience and reuse providers when possible.
- Normalize anchor IDs to your own state model for reliable entity updates.
- Treat ARKit streams as authoritative and keep rendering logic in RealityKit.
Provider References
| Provider |
When to Use |
WorldTrackingProvider |
When tracking device position and orientation in 3D space. |
HandTrackingProvider |
When tracking hand poses and gestures for interaction. |
PlaneDetectionProvider |
When detecting horizontal and vertical surfaces (floors, walls, tables). |
SceneReconstructionProvider |
When creating detailed 3D mesh reconstructions of the environment. |
ImageTrackingProvider |
When tracking known 2D images in the environment. |
ObjectTrackingProvider |
When tracking 3D objects in the environment. |
RoomTrackingProvider |
When tracking room boundaries and room-scale experiences. |
AccessoryTrackingProvider |
When tracking Apple Vision Pro accessories. |
BarcodeDetectionProvider |
When detecting and reading barcodes in the environment. |
CameraFrameProvider |
When accessing raw camera frames for custom processing. |
CameraRegionProvider |
When accessing camera frames from specific regions. |
EnvironmentLightEstimationProvider |
When estimating ambient lighting conditions. |
SharedCoordinateSpaceProvider |
When sharing coordinate spaces across multiple sessions. |
StereoPropertiesProvider |
When accessing stereo camera properties. |
General ARKit Patterns
| Reference |
When to Use |
REFERENCE.md |
When implementing ARKit session setup, authorization, and general provider patterns. |
Pitfalls and Checks
- In SwiftUI-first visionOS apps, prefer
RealityView for presentation and ARKitSession for tracking data; use ARView only when you specifically need its UIKit/AppKit-style view APIs.
- Do not assume every ARKit provider has the same presentation requirements; check the provider-specific guidance before choosing Shared Space, a volumetric window, or an immersive space.
- Do not block the main actor while awaiting provider updates.
- Do not drop session references; ARKit stops sessions on deinit.
1---2name: arkit-visionos-developer3description: ARKit visionOS Developer4---5# ARKit visionOS Developer67## Description and Goals89This skill provides comprehensive guidance for implementing ARKit-powered features on visionOS. ARKit on visionOS uses `ARKitSession` with data providers to access world tracking, hand tracking, plane detection, scene reconstruction, and other spatial data, which can then be bridged into RealityKit content.1011### Goals1213- Enable developers to set up and manage ARKitSession on visionOS14- Guide proper authorization handling for ARKit data providers15- Help developers choose and configure appropriate data providers16- Support anchor processing and RealityKit integration17- Ensure proper lifecycle management of ARKit sessions1819## What This Skill Should Do2021When implementing ARKit features on visionOS, this skill should:22231. **Guide ARKitSession setup** - Help you create and manage long-lived ARKitSession instances242. **Handle authorization** - Show how to request and check authorization for required data types253. **Select data providers** - Help you choose the right providers (world tracking, hand tracking, plane detection, etc.)264. **Process anchors** - Demonstrate how to consume anchor updates and map them to RealityKit entities275. **Manage lifecycle** - Ensure proper session start/stop and task cancellation286. **Bridge to RealityKit** - Show how to integrate ARKit anchors with RealityKit content2930Load the appropriate reference file from the tables below for detailed usage, code examples, and best practices.3132### Quick Start Workflow33341. Add `NSWorldSensingUsageDescription`, `NSHandsTrackingUsageDescription`, and `NSMainCameraUsageDescription` to `Info.plist` as needed for the providers you use.352. Use the presentation style required by the selected providers. Some providers require immersive space, while others have more specific rules.363. Create a long-lived `ARKitSession` and the data providers you need.374. Request authorization for provider-required data types before running the session.385. Run the session with your providers and observe `anchorUpdates` streams.396. Map anchors to RealityKit entities and keep state in a model layer.407. Observe `ARKitSession.events` for authorization changes and errors.418. Stop the session and cancel tasks when leaving the immersive space.4243## Information About the Skill4445### Core Concepts4647#### ARKitSession Lifecycle4849- Keep a strong reference to the session; call `run(_:)` with providers, stop on teardown.50- Sessions stop automatically on deinit, so maintain references throughout the immersive experience.5152#### Authorization5354- Use `requestAuthorization(for:)` or `queryAuthorization(for:)` and handle denied states gracefully.55- Request authorization before running the session with providers that require it.5657#### Data Providers5859- Choose providers for world tracking, plane detection, scene reconstruction, and hand tracking based on the feature set.60- Providers expose `anchorUpdates` streams that you consume to process anchors.6162#### Anchors and Updates6364- Consume provider `anchorUpdates` and reconcile added, updated, and removed anchors.65- Normalize anchor IDs to your own state model for reliable entity updates.6667#### RealityKit Bridge6869- Use `ARKitAnchorComponent` to inspect backing ARKit data on entities when needed.70- Treat ARKit streams as authoritative and keep rendering logic in RealityKit.7172### Implementation Patterns7374- Prefer one session per immersive experience and reuse providers when possible.75- Normalize anchor IDs to your own state model for reliable entity updates.76- Treat ARKit streams as authoritative and keep rendering logic in RealityKit.7778### Provider References7980| Provider | When to Use |81|----------|-------------|82| [`WorldTrackingProvider`](references/world-tracking-provider.md) | When tracking device position and orientation in 3D space. |83| [`HandTrackingProvider`](references/hand-tracking-provider.md) | When tracking hand poses and gestures for interaction. |84| [`PlaneDetectionProvider`](references/plane-detection-provider.md) | When detecting horizontal and vertical surfaces (floors, walls, tables). |85| [`SceneReconstructionProvider`](references/scene-reconstruction-provider.md) | When creating detailed 3D mesh reconstructions of the environment. |86| [`ImageTrackingProvider`](references/image-tracking-provider.md) | When tracking known 2D images in the environment. |87| [`ObjectTrackingProvider`](references/object-tracking-provider.md) | When tracking 3D objects in the environment. |88| [`RoomTrackingProvider`](references/room-tracking-provider.md) | When tracking room boundaries and room-scale experiences. |89| [`AccessoryTrackingProvider`](references/accessory-tracking-provider.md) | When tracking Apple Vision Pro accessories. |90| [`BarcodeDetectionProvider`](references/barcode-detection-provider.md) | When detecting and reading barcodes in the environment. |91| [`CameraFrameProvider`](references/camera-frame-provider.md) | When accessing raw camera frames for custom processing. |92| [`CameraRegionProvider`](references/camera-region-provider.md) | When accessing camera frames from specific regions. |93| [`EnvironmentLightEstimationProvider`](references/environment-light-estimation-provider.md) | When estimating ambient lighting conditions. |94| [`SharedCoordinateSpaceProvider`](references/shared-coordinate-space-provider.md) | When sharing coordinate spaces across multiple sessions. |95| [`StereoPropertiesProvider`](references/stereo-properties-provider.md) | When accessing stereo camera properties. |9697### General ARKit Patterns9899| Reference | When to Use |100|-----------|-------------|101| [`REFERENCE.md`](references/REFERENCE.md) | When implementing ARKit session setup, authorization, and general provider patterns. |102103### Pitfalls and Checks104105- In SwiftUI-first visionOS apps, prefer `RealityView` for presentation and `ARKitSession` for tracking data; use `ARView` only when you specifically need its UIKit/AppKit-style view APIs.106- Do not assume every ARKit provider has the same presentation requirements; check the provider-specific guidance before choosing Shared Space, a volumetric window, or an immersive space.107- Do not block the main actor while awaiting provider updates.108- Do not drop session references; ARKit stops sessions on deinit.