我正在开发一个应用程序,我知道我的数据库*.db将出现在data/data/com.****.***

我可以在sqlite管理器的帮助下从Eclipse中的AVD访问这个文件

但是我的安卓手机无法访问这个文件。 我谷歌了一下,它说我需要在我的手机上查找,但我不想这样做。

我如何访问我的data/data/.....目录在我的安卓手机“没有根它”?

是否可以更改目录data/data.....的用户权限没有生根?


当前回答

SQLlite数据库存储在用户的手机,它隐藏在路径下:

/Data/Data/com.companyname.AppName/File/

你有两个选择:

你可以根你的手机,这样你就可以查看你的隐藏 db4文件 这不是解决方案,而是一种变通办法。为什么不直接创建测试呢 使用“select”语句在其中显示数据库表的页面。

其他回答

adb backup didn't work for me, so here's what I did (Xiaomi Redmi Note 4X, Android 6.0): 1. Go to Settings > Additional Settings > Backup & reset > Local backups. 2. Tap 'Back up' on the bottom of the screen. 3. Uncheck 'System' and 'Apps' checkmarks. 4. Tap detail disclosure button on the right of the 'Apps' cell to navigate to app selection screen. 5. Select the desired app and tap OK. 6. After the backup was completed, the actual file need to be located somehow. Mine could be found at /MIUI/backup/AllBackup/_FOLDER_NAMED_AFTER_BACKUP_CREATION_DATE_. 7. Then I followed the steps from this answer by RonTLV to actually convert the backup file (.bak in my case) to tar (duplicating from the original answer): " a) Go here and download: https://sourceforge.net/projects/adbextractor/ b) Extract the downloaded file and navigate to folder where you extracted. c) run this with your own file names: java -jar abe.jar unpack c:\Intel\xxx.ab c:\Intel\xxx.tar "

你可以复制这个db文件到eclipse资源管理器的某个地方(例如:sdcard或PC),你可以使用sqlite访问和更新这个db文件。

打开命令提示符 将目录改为E:\Android\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\platform-tools 输入以下命令 Adb -d shell 执行命令-as com.your.packagename cat databases/database.db > /sdcard/database.db 将目录更改为cd /sdcard,确保database.db在那里。 Adb pull /sdcard/database.db或者简单地从设备复制database.db。

使用eclipse中的文件资源管理器。Select Windows => Show View => Other…>文件资源管理器。

另一种方法是通过adb提取文件:

adb pull /system/data/data/<yourpackagename>/databases/<databasename> /sdcard

可能要访问这个文件夹需要管理员权限。

所以你有两个选择:-

根您的设备,然后尝试访问此文件夹 使用模拟器

附注:如果您正在使用上述两个选项中的任何一个,您可以通过以下步骤访问此文件夹

打开DDMS透视图->您的设备->(选择文件资源管理器从 右窗口选项)选择package -> data -> data -> package name - >文件

从那里你可以调出你的文件