查看使用 Room Persistence Library 创建的数据库内容 [英] View contents of database created with Room Persistence Library
问题描述
有没有更简单的方法可以在 Android Studio 中查看使用 Room Persistence Library 创建的数据库的内容?
Is there any easier way to see the contents of database created with Room Persistence Library in Android Studio?
推荐答案
Android Studio 正式支持Database Inspector
之前,Database Inspector 开始包含在 Android Studio 4.1 canary 频道中,现在它已经内置在最新版本的 Android Studio Arctic Fox 中.
Database Inspector Officially Support in Android Studio
Previouslly, Database Inspector start to include in Android Studio 4.1 canary channel, now it is already build in with the latest version of Android Studio Arctic Fox.
现在,数据库检查器位于应用检查选项卡下.您必须选择连接的设备,然后需要选择要检查数据库的包名称.
Now, Database Inspector is under the App Inspection Tab. You have to choose your connected device, then need to choose package name that you want to inspect for database.
左侧显示可用表格,需要双击查看表格详情,右侧会显示..
In the left side, show the available tables and need to double click to see table details, and it will be show in the right side..
您可以使用 Android-Debug-Database,您可以对数据进行 CRUD从浏览器,然后您可以从浏览器看到您的首选项数据.
You can use Android-Debug-Database, and you can CRUD of your data from a browser, and then you can see your Preference data from a browser.
如果您不想从浏览器中使用并且您必须检查其他文件,需要检查您的数据更改,请使用 Genymotion 模拟器.所以您必须对您的模拟器进行 root.尝试对您的模拟器进行 Root,请参阅https://stackoverflow.com/a/44039429/2772552.如果您不满意,请告诉我.
If you don't want to use from Browser and you have to check other files,need to check your data changes, use a Genymotion Emulator.So you have to root your emulator.Try to Root your emulator, plz see in https://stackoverflow.com/a/44039429/2772552. Let me know if you are not OK.
这篇关于查看使用 Room Persistence Library 创建的数据库内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!