自应用发布以来,我一直在使用Android Studio开发应用。
直到最近,一切都很好,我必须调试和检查数据库文件。由于我不知道如何直接看到数据库,当我调试生成数据库文件时,我不得不将数据库文件从我的手机导出到PC上。
为此,我必须打开DDMS >文件资源管理器。一旦我打开DDMS,我必须重新连接USB,我失去了调试线程。在检查数据库文件之后,我必须关闭DDMS并重新连接USB以回到调试模式。
这太复杂了。有人有更好的方法来做到这一点在Android Studio(我知道它更容易在Eclipse) ?
Follow the above steps to open the database folder of your app in Android Device explorer and in there you can see six files, The first three is named as android and the last three is named as your database name. You only have to work with the last three files, save these three files at your preferred location. You can save these files by right-clicking to the file and click save as button (like I have my database named as room_database and so three files are named as room_database, room_database-shm, and room_database-wal. Rename the corresponding file as follows:-
1)从room_database到room_database.db
2) room_database-shm到room_database.db-shm
3) room_database-wal到room_database.db-wal
现在在任何SQLite浏览器中打开第一个文件,这三个文件都将被填充到浏览器中。