访问我的 Android 设备(LG Optimus one p500)上的应用程序数据库
我为我的 Android 设备创建了一个 Android 应用程序,它将记录存储到 sqlite 数据库中,甚至从数据库中检索数据也能在我的应用程序上正常工作。现在我想访问位于以下位置的数据库文件:
/data/data/org.project.compdroid.dash1/databases/data
其中 data 是我的数据库文件。 我想将此数据文件导出到我的电脑以保留所有记录的备份。 从模拟器访问它
为此,我首先尝试通过命令adb pull /data/data/org.project.compdroid.dash1/databases/data [本地地址路径]
,这对于模拟器来说可以正常工作。但是当我尝试从 Android 手机复制相同的文件时,它说权限被拒绝。我认为,由于我不是手机的 root 用户,因此我不允许访问它,并且允许我在模拟器中实现它,因为我已经在那里扎根了。 现在有没有一种方法可以让我在不root的情况下从我的Android手机复制数据文件?或者 root 是解决我的问题的唯一方法吗?
请建议任何其他技术(如果有的话)将数据库文件从 Android 手机复制到我的计算机。
提前致谢...
I have created an android application for my Android device which stores records into sqlite databases and even the retrieval of the data from the database works correctly on my application. Now i want to access the database file located in the location as follows:
/data/data/org.project.compdroid.dash1/databases/data
where data is my database file.
This data file i want to export to my pc to keep a backup of all the records.
for this I first tried accessing it from the emulator by the command
adb pull /data/data/org.project.compdroid.dash1/databases/data [local address path]
this worked correctly for the emulator. but when i try to copy the same file from my Android phone it says permission denied. I think since I am not the root user for my phone I am not allowed to access it and I am allowed to achieve it in my emulator since I am already rooted there.
Now is there a way by which i will be able to copy the data file from my android phone without rooting it? or is rooting the only solution for my problem?
Please do suggest any other technique(if there are any) for copying the database files from an android phone to my computer.
Thanks in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在应用程序中包含代码,将文件从内部存储复制到 SD 卡上,因为您的应用程序可以完全访问自己的存储空间。请参阅如何将数据库备份到SD和备份你的 Android..
你也可以将 Db 作为文本文件吐出然后可以将其导入到任何数据库中。
You can include code in your app that will copy the file from internal storage onto the sd card, since your App has full access to its own storage. See How to backup database to SD and Backing up your Android..
You could also spit out the Db as a text file which can then be imported into any DB.