Xcode Tools for Testing ARKit 2 in iOS 12

With the release of iOS 12 and ARKit 2, Apple updated Xcode to version 10, bringing specialized debugging and profiling tools designed specifically for augmented reality development. This article outlines the developer tools integrated into Xcode for testing ARKit 2, including dedicated Instruments templates, enhanced 3D visual debugging, USDZ asset workflows, and world-map serialization tools.

ARKit Template in Instruments

Xcode 10 introduced a dedicated ARKit profiling template within Apple Instruments. This tool allows developers to analyze the performance of AR experiences in real time by tracking:

  • Tracking State and Quality: Visualizes changes between tracking states (Not Available, Limited, Normal) and diagnoses reasons for limited tracking, such as excessive motion or insufficient visual features.
  • Frame Rate and Latency: Monitors the cadence of camera frame delivery and render loops to identify drops below the target 60 frames per second.
  • Thermal and System Impact: Correlates intensive computer vision workloads with CPU/GPU thermal pressure, helping identify thermal throttling issues on physical devices.
  • Anchor and Point Cloud Density: Displays the active count of detected feature points and anchors over time.

ARWorldMap Testing and Serialization

ARKit 2 introduced persistent and multi-user AR sessions powered by the ARWorldMap object. To test these features, Xcode enabled streamlined workflows for capturing, serializing, and replaying spatial data:

  • Session Archiving: Developers could serialize spatial mapping data to disk using NSKeyedArchiver directly inside test routines, enabling the reuse of physical environment data across test runs.
  • Mock Multi-User Testing: By loading serialized ARWorldMap files onto multiple physical test devices via Xcode's application container management, developers could simulate and debug peer-to-peer localization without needing to repeatedly re-map the physical space manually.

Visual Debugging and SceneKit Enhancements

Xcode’s SceneKit editor and runtime visual debugging options were expanded to accommodate ARKit 2's new capabilities:

  • Environment Probe Inspection: To test ARKit 2’s automatic environment texturing, Xcode provided visual tools to inspect AREnvironmentProbeAnchor placements and cubemap reflections directly in the runtime scene graph.
  • Debug Overlays: Xcode streamlined the activation of AR-specific visual flags (ARSCNDebugOptions), such as rendering the real-time feature point cloud, coordinate world origins, detected planar surfaces, and estimated light anchor positions directly on the device display.

Native USDZ Integration

Xcode 10 introduced native integration for USDZ, the open file format developed by Apple and Pixar for 3D content:

  • Direct Asset Previewing: Developers could inspect 3D assets, lighting responses, and PBR (Physically Based Rendering) materials within Xcode's interface without third-party converters.
  • Command-Line Tools: Xcode included Python-based USD utilities to validate, convert, and inspect 3D assets before deploying them into ARKit 2 rendering pipelines or AR Quick Look.