daniel.jbatiz
daniel.jbatiz

Reputation: 447

How can I get my Realm Database in a file to open in Realm Studio?

I'm using Android Studio in macOS. My application has a Realm Database with a lot of tables. I'd like to get the database from my device and put it in a file (.realm) and open the file in Realm Studio.

Maybe using ADB I could get the database from my phone ?

Upvotes: 2

Views: 3880

Answers (2)

Mish
Mish

Reputation: 145

You can find your realm file in the Device File Explorer tab at the bottom right of Android Studio. The location will be /data/data/com.<package-name>/files/default.realm assuming you haven't named your realm file. Simply right-click and "Save As" to a location on your PC and open in Realm Studio. You can't view the realm file on the actual device so you will have to download this realm file every time you want to inspect what's happening in realm. This also means that you need to download the realm file every time you make a change in realm that you want to inspect as you're not actually opening the realm file on the device.

Upvotes: 4

daniel.jbatiz
daniel.jbatiz

Reputation: 447

I've solved this by writing adb pull /data/data/packagename/files/ . in terminal.

package name Eg. com.example.helloworld adb pull /data/data/com.example.helloworld/files/ .

after doing that write open . in terminal and you'll have the file default.realm

Upvotes: 1

Related Questions