如何在真实设备中查看我的应用程序的 sqlite db 的内容? [英] How can I see the contents of a sqlite db of my app in a real device?
本文介绍了如何在真实设备中查看我的应用程序的 sqlite db 的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我部署的设备中查看在我的应用程序中创建的数据库的内容.我可以在 shell 中使用 sqlite 命令并在模拟器中查看,但不能在真实设备中查看.
I want to see the contents of my database created in my app in the device I deploied it. I can use sqlite commands in shell and see in emulator but not in a real device.
谁能知道如何在真实设备中做到这一点?
Can anyone know how to do it in real device?
推荐答案
如果应用程序被标记为可调试,则不需要 root.您可以使用 run-as
adb 命令.
root is not necessary if the application is flagged a debuggable. You can use the run-as
adb command.
例如使用 sqlite :
e.g. to use sqlite :
adb shell "run-as com.your.package sqlite3 databases/database_name"
或复制并拉取数据库:
adb shell "run-as com.your.package cat databases/database_name > /sdcard/some_name"
adb pull /sdcard/some_name
不幸的是,ICS 之前的 run-as
似乎有很多错误,例如问题 20792 或 13965
unfortunately it seems that pre-ICS run-as
has quite a few bugs, e.g. issue 20792 or 13965
这篇关于如何在真实设备中查看我的应用程序的 sqlite db 的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文