How to Debug SceneKit and ARKit in Xcode

Gabriel Lewis
4 min readAug 27, 2018

SceneKit is one of my favorite Apple iOS Frameworks. It allows for developers at all different levels to create 3D scenes and animations. When things go wrong though it can be difficult to find the cause. Here are a few tips to diagnose issues.

1. Scenekit graph Debugger

If you only take away one thing from this post let it be this. The biggest issues with scenekit is usually managing the hierarchy of SCNNode objects. Sometimes node are out of place or not showing up in the scene at all. Using this tip you can stop the app and view the scene and all the nodes in the hierarchy.

In this example I’m going to be debugging an ARKit scene where I should have two objects (candle, and coffee cup) but I only see one.

First open your problematic SceneView and make sure it is visible on the screen. And then click the Debug View Hierarchy button.

It will take a second for Xcode to capture the full view hierarchy, but when it’s finished it should look like this. As you can see, only the coffee cup is visible.

--

--