Retrieve database or any other file from the Internal Storage using run-as

后端 未结 12 2218
清酒与你
清酒与你 2020-11-22 11:01

On a non-rooted android device, I can navigate to the data folder containing the database using the run-as command with my package name. Most files types I am c

12条回答
  •  不思量自难忘°
    2020-11-22 11:36

    The database file is emtpy when using adb run-as. This can be resolved by calling close() on the RoomDatabase instance. Call close() to let SQLite write its journal to disk. I've created this button that closes the database connection on request:

    via GIPHY

    Here is how to call close on the RoomDatabase instance.

提交回复
热议问题