无法通过adb shell访问数据库文件...显示权限被拒绝 [英] Not able to access the database file through adb shell... shows permission denied

查看:551
本文介绍了无法通过adb shell访问数据库文件...显示权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从手机中检索数据库文件.我正在使用cmd和adb shell来执行此操作.当我执行ls后访问数据/数据后,它显示权限被拒绝. 我已经打过电话了. USB调试已打开. 我的CMD图像已附加.请指导我错了.预先感谢

I am trying to retrieve the database file from the phone. I am using the cmd and adb shell to do this. After access data/data when i do ls, it shows permission denied. I have phone my rooted. USB debugging is on. My CMD image is attached. Please guide where i am wrong. Thanks in advance

推荐答案

列出所有拥有的数据库:

To list all databases that you have:

adb shell run-as com.example.myapp ls /data/data/com.example.myapp/databases/

要下载它们,请先将它们复制到sdcard,然后将其拉出:

To download them, first, copy them to sdcard and then, pull it:

adb shell run-as com.example.myapp cp /data/data/com.example.myapp/databases/DATABASE_NAME /sdcard/

adb pull /sdcard/DATABASE_NAME

注意:

请记住用应用程序中的程序包名称替换com.example.myapp.

Remember to replace com.example.myapp by package name from your app.

AndroidManifest.xml

<manifest 
    package="com.example.myapp"/>
    ....
</manifest>

这篇关于无法通过adb shell访问数据库文件...显示权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆