Search code examples
iosswiftxcoderealmrealm-mobile-platform

How to view RealmSwift managed objects and properties in Xcode debugger


I just downloaded the latest version of RealmSwift and added it to my project as per the instructions using pod install. I am trying to use the Xcode debugger to view the Realm managed objects (which have a List, Strings and Doubles). These values in these objects are not viewable in the debugger. I can only see the address but not the values. Do I have to add any flags to the Xcode debugger or enable any debug symbols so that I can view these variables? I am using Xcode 12

Thanks for your help!


Solution

  • There's a plug in that allows you to view Realm Values in XCode's debugger pane.

    It's in a folder called plugin in the main Realm Cocoa github and needs to be downloaded, built and run.

    Best bet is to download the whole thing as a zip from the top level, then navigate to the plugin folder and open the project from there.

    Keep in mind that Realm objects are lazily loaded - meaning they are not loaded until they are used so thats the reason for the plug in.