Issue
I need to populate a file .db programmatically so then I can put this in my asset folder of another project. So I'm trying to put a lot of data with Room in an empty database and then get the filled .db from the device using ADB shell.
I'm trying to save on my pc the .db file with this command on the ADB shell
adb exec-out run-as com.group.project cat databases/file.db > file.db
But the new file that I saved has no data and I'm sure it contains some records because I tried to query the database
Solution
Use Database Inspector.
The latest version of Android Studio (Arctic Fox) can export database: https://youtu.be/-8tSZr7iMcw?t=288
- Helpful reading: https://medium.com/androiddevelopers/database-inspector-9e91aa265316
Answered By - Sam Chen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.