Example of using ARKit's private SPI to record and replay session sensor data
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ARRecorder.xcodeproj Initial commit Sep 25, 2018
ARRecorder Add icon Dec 4, 2018
.gitignore Initial commit Sep 25, 2018
LICENSE Initial commit Sep 25, 2018
README.md Added an icon to the Readme. Dec 4, 2018
icon@2x.png Added an icon to the Readme. Dec 4, 2018

README.md

AR Recorder icon AR Recorder

This project demonstrates how ARKit's private SPI can be used to record and replay AR sessions, thus enabling a convenient development workflow and test automation.

Disclaimer: Functionality exposed and used in this project is private SPI. It's not guaranteed to be reliable or stay available in any form in future versions of ARKit. It definitely cannot be used in production versions of apps distributed on the App Store.

How to build

Clone the repository and open ARRecorder.xcodeproj in Xcode 10 or newer. Configure automatic codesigning by opening project settings, ARRecorder target, General, and configuring the Team setting in the Signing section.

How to use

The app starts a normal AR session once launched. Tap Record to start recording the session to a local file. Then tap Finish to complete the recording and continue a normal session. To replay a previously recorded session, tap Replay, then select the file. To stop the replay at any time, tap .

During both normal, recording and replay sessions, tap anywhere to place a virtual cube in the scene at the estimated physical location that corresponds to your touch. Note that this won't be recorded into the replay file: you can interact with the session differently during recording and replay.

To delete a recorded file, tap Replay and swipe left on a file row, then tap Delete. You can also access all session recordings using the Files app by selecting On My iPhone/iPad location, where ARRecorder's documents container will show up. The app is also configured to allow File Sharing via iTunes.

SPI declaration

Relevant SPI classes and methods are annotated in ARRecordingTechnique.h and ARReplaySensor.h. Their signature and presumed function have been observed as of ARKit 2.0.

Supported devices

All iOS 11.3+ devices with A9 chip or newer are supported. This includes:

  • iPhone SE
  • iPhone 6S, 6S Plus or newer
  • iPad (2017, 5th generation) or newer

The project can be modified to support a wider range of hardware by replacing session's world tracking configuration with an orientation tracking configuration.

Licensing

This work is licensed under a BSD 3-Clause License.