pull a database from genymotion emulator on to local disk

可紊 提交于 2019-12-05 02:51:03

问题


I am using genymotion for my dev and when I create a database I can't see it in DDMS folder of genymotion emulator.

When searched on google I am able to see the database on adb shell but don't know how to pull the database to my local disk to view the data.

Can anyone please let me know the process.

Thanks in advance


回答1:


You can (also) pull the data from your device to your host by copying it to a shared folder:

adb shell su 0 cp /data/data/<package.name>/databases/<database.name> /mnt/shared/

Here is how to setup the shared folder:

  • Go to your VirtualBox VM setting / Shared folder tab
  • Add a shared folder with the folder you want to shared, and check the "auto mount" option
  • Start your VM as usual from the Genymotion software
  • Your shared folder is available in the /mnt/shared directory (multiple shared folders are supported)



回答2:


Try on Genymotion 2.3:

adb shell su -c cp /data/data/<package.name>/databases/<database.name> /sdcard/

and on other version :

adb shell su 0 cp /data/data/<package.name>/databases/<database.name> /sdcard/

And pull it from the device

adb pull /sdcard/<database.name>

(edited, not the same comportment of su in 2.3 and 4.3)




回答3:


pull database using adb commands

 adb pull /data/data/com.android.packagename/databases.datebase.db

the db will be pulled to current location where terminal is pointing to

then open db using sqliteman



来源:https://stackoverflow.com/questions/20327740/pull-a-database-from-genymotion-emulator-on-to-local-disk

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