gpt4 book ai didi

Android stetho 谷歌开发者工具资源被截断

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:46:14 26 4
gpt4 key购买 nike

使用 Stetho 和 Stetho Realm。

Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
.build());

我可以使用 Google Developer Console 查看 Realm DB 内容,但最大索引为 249,之后的所有值都被截断了 -

enter image description here

如何强制它显示所有值?

最佳答案

原因是 Stetho 内部的限制。在类里面

com.facebook.stetho.inspector.protocol.module.Database

https://github.com/facebook/stetho/blob/36aa5bd356d9cf5893b9424b06a83dda9ec5e44f/stetho/src/main/java/com/facebook/stetho/inspector/protocol/module/Database.java

有这个信息-

  /**
* 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());

关于Android stetho 谷歌开发者工具资源被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40383510/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com