【发布时间】:2015-03-29 00:40:51
【问题描述】:
我使用的是最新版本的 Android Studio。当我在模拟器上运行我的应用程序时,我可以通过以下方式查看我的数据库:
tools -> Android Device Monitor -> clicking on the emulator in the left panel -> file explorer -> data -> data -> com.project-name
但在设备上运行我的应用时,此选项不可用。
我已经检查了相关问题:
- Android - viewing SQLite databases on device?这里投票最多的答案建议将数据库复制到SDcard,甚至是eclipse。
- Access sqlite database on android device
这些问题来自 2011 年和 2010 年。 有没有我可以使用的插件或其他外部工具?
【问题讨论】:
-
“但在设备上运行我的应用程序时,此选项不可用”——正确。这与您选择的 IDE 无关。您可以使用
adb shell run-as(请参阅 this answer 到您的第二个链接问题)。 -
如果您只想查看您的数据库,您可以从 Playstore 下载 DB Browser。
-
@Opiatefuchs 我刚刚下载了 DB Browser。如何找到我的数据库?
-
选择“搜索数据库”并输入您的数据库的确切名称...
标签: android sqlite android-studio