Search code examples
javaandroidrealm

How do I view my Realm file in the Realm Browser?


I've just discovered Realm and wanted to explore it in more detail so I decided to create sample application and having a mess around with it. So far so good.

However, one thing I haven't been able to work out just yet is how to view my database in the Realm Browser. How can this be done?


Solution

  • Currently the Realm Browser doesn't support accessing databases directly on the device, so you need to copy the database from the emulator/phone to view it. That can be done by using ADB:

    adb pull /data/data/<packagename>/files/ .

    That command will pull all Realm files created using Realm.getInstance(new RealmConfiguration.Builder().build()) . The default database is called default.realm.

    Note that this will only work on a emulator or if the device is rooted.