如何在领域浏览器中查看我的Realm文件

如何在领域浏览器中查看我的Realm文件

本文介绍了如何在领域浏览器中查看我的Realm文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚发现了Realm,并且想要更详细地探索它,所以我决定创建示例应用程序并搞乱它。到目前为止一切顺利。

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.

然而,我还没有解决的一件事是如何在Realm Browser中查看我的数据库。怎么办呢?

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?

推荐答案

目前Realm Browser不支持直接在设备上访问数据库,所以你需要从模拟器/手机复制数据库以查看它。这可以通过使用ADB来完成:

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 /。

该命令将获取使用 Realm.getInstance(new RealmConfiguration.Builder()。build())。默认数据库名为 default.realm

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.

这篇关于如何在领域浏览器中查看我的Realm文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 14:11