android adb,使用run-as检索数据库 [英] android adb, retrieve database using run-as

查看:453
本文介绍了android adb,使用run-as检索数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在无根的Android设备上,我可以使用包含名称的 run-as 命令导航到包含数据库的数据文件夹。大多数文件类型我只是查看内容,但与数据库我想拉从如果从android设备。

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 content with just viewing, but with the database I would like to pull if from the android device.

有一个下载从adb shell的这一部分中删除 copy move 我想使用数据库浏览器下载数据库文件并查看其内容。

Is there a download copy or move command from this part of adb shell? I would like to download the database file and view its content using a database browser.

这里的一个答案包括将整个应用程序包转换为压缩归档文件,但没有其他回答如何解压缩归档文件一旦完成并移动到机器,留下非常sidetracked当可能有一个更直接的解决方案开始

One answer here involves turning entire application package into a compressed archive, but there is no further answer on how to extract that archive once this is done and moved to the machine, leaving me very sidetracked when there might be a more direct solution to begin with

谢谢

推荐答案

adb shell "run-as package.name chmod 666 /data/data/package.name/databases/file"
adb pull /data/data/package.name/databases/file .
adb shell "run-as package.name chmod 600 /data/data/package.name/databases/file"

UPDATE

Android 5.0+的命令可保存/data/data/package.name/databases/file将是:

the command for Android 5.0+ to save /data/data/package.name/databases/file would be:

adb exec-out run-as package.name cat databases/file > file

这篇关于android adb,使用run-as检索数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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