ARKit 2 Debugging Visualizations in iOS 12
With the release of iOS 12 and ARKit 2, Apple expanded the diagnostic toolset available to augmented reality developers, making it significantly easier to inspect spatial tracking, environmental understanding, and scene anchors. This article outlines the key debugging visualizations and inspection features introduced in ARKit 2, detailing how they allow developers to monitor complex systems like irregular plane geometry, environment reflection probes, 3D object detection, and world-mapping states in real time.
ARPlaneGeometry Visualization
Prior to ARKit 2, developers could only visualize plane detection
using simple rectangular bounding boxes. iOS 12 introduced
ARPlaneGeometry, enabling the visualization of exact,
irregular surface contours.
- Mesh Rendering: Developers can render a dynamically updating triangle mesh that closely mirrors the real-world shape of detected tables, floors, and walls.
- Refined Boundaries: Visualizing the actual polygon boundary helps identify how the system merges adjacent planes and accommodates non-rectangular physical surfaces.
Environment Texturing and Reflection Probes
ARKit 2 introduced AREnvironmentProbeAnchor, which
generates cube-map textures from the physical surroundings to provide
realistic reflections on virtual objects.
- Cubemap Inspection: Developers can visualize these reflection probes as reflective spheres placed directly into the SceneKit scene.
- Anchor Coverage: Placing visible test spheres allows developers to see where probes are automatically or manually generated and how reflection textures blend across different areas of the room.
World Mapping Status Tracking
Persistent and multi-user AR experiences rely on
ARWorldMap. To debug how well a physical space is being
mapped, ARKit 2 introduced visual tracking indicators via
worldMappingStatus.
Developers could link visual UI elements or debug overlays to the four mapping states:
- Not Available: Mapping data is insufficient or tracking is unavailable.
- Limited: The device has not gathered enough visual features to localize or persist the space.
- Extending: ARKit is actively learning and adding new feature points to the environment map.
- Mapped: The space is thoroughly mapped and ready to be saved or shared with nearby devices.
3D Object Detection Bounding Boxes
iOS 12 added support for scanning and recognizing physical 3D objects
using ARReferenceObject.
- Bounding Volumes: When a scanned reference object is detected in the real world, developers can visualize its 3D oriented bounding box.
- Anchor Alignment: This visualization helps verify whether the recognized object’s origin, scale, and orientation correctly match the physical item.
Xcode AR Inspection and Frame Recording
Alongside ARKit 2, Xcode introduced deep debugging integration for live AR sessions:
- AR Frame Capture: Developers can pause a running ARKit session and capture a complete snapshot of the 3D scene directly into Xcode.
- Point Cloud and Anchor Inspection: The captured frame displays the current point cloud, camera frustum, detected planes, and all anchored entities in 3D space, allowing frame-by-frame inspection of tracking errors without writing custom debug code.