使用Stetho和Stetho Realm。
Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
.build());
我能够通过Google Developer Console查看Realm DB内容,但最大索引是249,之后的所有值都被截断 -
如何强制它显示所有值?
答案 0 :(得分:8)
原因是Stetho内部的限制。在课堂上
com.facebook.stetho.inspector.protocol.module.Database
有这个信息 -
/**
* The protocol doesn't offer an efficient means of pagination or anything like that so
* we'll just cap the result list to some arbitrarily large number that I think folks will
* actually need in practice.
* <p>
* Note that when this limit is exceeded, a dummy row will be introduced that indicates
* truncation occurred.
*/
private static final int MAX_EXECUTE_RESULTS = 250;
对于Realm Stetho,可以通过这种方式更改限制 -
Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this)
.withFolder(getCacheDir())
.withMetaTables()
.withDescendingOrder()
.withLimit(100000)
.build())
.build());