Android Studio中的数据库文件的浏览内容 [英] View contents of database file in Android Studio

查看:340
本文介绍了Android Studio中的数据库文件的浏览内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直使用的 Android的工作室,以发展我的应用程序,因为它被释放。

I have been using Android Studio to develop my app since it's was released.

一切工作不错,直到最近,我必须与检查数据库文件一起进行调试。因为我不知道如何直接查看数据库,当我调试生成的数据库文件,我必须将数据库文件从手机中导出到PC。

Everything works nice until recently, I have to debug together with checking the database file. Since I don't know how to see the database directly, When I debugged to generate the database file, I have to export the database file from my phone to the PC.

在为了做到这一点,我不得不打开 DDMS>文件浏览器。当我打开DDMS,我必须重新连接USB,和我失去了我调试线程。检查数据库文件后,我不得不关闭DDMS,并再次重新连接USB,回到调试模式。

In order to do this, I have to open DDMS > File Explorer. Once I open the DDMS, I have to reconnect the USB, and I lose my debug thread. After checking the database file, I have to close the DDMS and reconnect the USB again to get back to the debug mode.

这太复杂了。有没有人有一个更好的办法Android Studio中(我知道它在Eclipse中更容易),这样做呢?

It's just too complicated. Does anyone have a better way to do this in Android Studio (I know it's easier in Eclipse) ?

推荐答案

最后,我发现这并不需要打开一个DDMS简单的解决方案。

Finally, i found a simplest solution which do not need to open the DDMS.

实际上,该溶液是基于什么@Distwo提到,但不必是复杂。

Actually, the solution is based on what @Distwo mentioned, but it don't have to be that complicated.

第一,请记住您的数据库文件中的设备的路径,它应该跳投一样。
   比如我的是: /data/data/com.XXX.module/databases/com.XXX.module.database

First, remember the path of your database file in the device, it should aways the same. For example mine is:/data/data/com.XXX.module/databases/com.XXX.module.database

,执行此命令,它拉你的数据库文件到您的PC

Second, execute this command which pulls your database file onto you PC

 adb pull /data/data/com.XXX.module/databases/com.XXX.module.database /Users/somePathOnYourPC/

您需要做的仅仅是复制并存储该命令是什么,那么你可以一次又一次地使用它。

What you need to do is just copy and store this command, then you can use it again and again.

第三,如果你得到许可被拒绝或类似的东西,只需运行 ADB根前的previous命令。

Third, if you got Permission Denied or something like that, just run adb root before the previous command.

这篇关于Android Studio中的数据库文件的浏览内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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