Copy sqlite db file from Android terminal to Windows OS

不问归期 提交于 2019-12-13 23:35:42

问题


I want to copy the sqlite database from data/data/[package name]/databases/ to Windows Operating system.

Currently, I am inside Android Terminal shell of Android studio and my current path is /data/data/example.com.sensor/databases.

There is a sqlite file in this directory. The name is sensor.sqlite.

This is perhaps an easy question for experience user like you. However, I have spent 2 hours yet I find the result.

Thank you.

Regards,

Jimmy


回答1:


Since your device is not rooted, you cannot do this from outside of the application. If it's your application, you can add a temporary routine into the application to copy the database to public storage, then use adb or MTP to copy the file to your Windows computer.

Or, you can just root your device.




回答2:


See below attached image. * To pull any file(note here you can pull only file,not folder). -> As you can see just select your device from Device tab (On left). -> Then Goto File Explorer tab and find path of your database.

As in image you can see I have open database directory of com.android.browser package application.

If you got some problem of finding your app package there, See another screen-shot below.And find app as directed there.




回答3:


Steps :

  1. Open Android Device Monitor.

  1. Make sure your device is online & if your device is online, you will see like this in left side (Available device). Choose your device & in the centre at File Explorer tab, you can see the db file exists. The path is data/data/Your-Application-package/databases/Your-db-file

  1. In the right top side, click Pull once you selected your db file and save it with extension .sqlite.


来源:https://stackoverflow.com/questions/29866987/copy-sqlite-db-file-from-android-terminal-to-windows-os

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!