“无效的文件格式"从设备在Nexus 4中提取的* .db文件中-Android 5.1.1 [英] "Invalid file format" from device pulled *.db file in Nexus 4 - Android 5.1.1

查看:70
本文介绍了“无效的文件格式"从设备在Nexus 4中提取的* .db文件中-Android 5.1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Android开发.而且,从设备中提取的数据库文件打开时,我总是收到此错误:无效的文件格式"

我使用此命令拉出

  adb shell运行包chmod 666/data/data/package/files/database"adb exec-out run-as软件包cat文件/数据库>C://测试/数据库 

我想,文件的大小是正确的,当我使用文本编辑器打开文件时,我当然可以读取带有特殊字符的内容.但是sqliteBrowser无法读取它.

解决方案

尽管我使用的是ubuntu 16.04和sqlite浏览器,但我在android 4.2上也遇到了同样的问题.

我发现只有一种方法可以访问未扎根电话的文件系统,最后可以打开数据库文件.

开始 FileZilla
打开 Site Manager ,并添加具有SSHDroid ssh服务器设置的新站点.

/mnt/sdcard 设置为默认远程目录

并通过SFTP协议连接到手机

I'm learning Android developement. And I receive always this error while opening a pulled database file from device: "Invalid file format"

I use this commands to pull the

adb shell "run-as package chmod 666 /data/data/package/files/database"
adb exec-out run-as package cat files/database > C://test/database

I thik, the file size is correct, and when I open it in with a text editor I can read the content, with special characters, of course. But the sqliteBrowser can't read it.

解决方案

I had a same problem with android 4.2, although I used ubuntu 16.04 and sqlite browser instead.

I found only one way that I could access my not rooted phone's file system and finally I could open the database file.

Install SSHDroid on your phone

adb -d shell "run-as your.package.name cat databases/database_name.db > /mnt/sdcard/database_name.db"

just for sure, you can check whether the file is there

$ adb shell
shell@android:/ $ cd /mnt/sdcard
shell@android:/mnt/sdcard $ ls

if you don't know the exact name of your package then

adb shell 'pm list packages -f'

start the SSHDroid

the default username is root and the default password is admin. It makes sense to change the password.

start FileZilla
open the Site Manager and add a new site with the settings of the SSHDroid's ssh server.

set /mnt/sdcard as default remote directory

and connect to your phone via SFTP protocol

这篇关于“无效的文件格式"从设备在Nexus 4中提取的* .db文件中-Android 5.1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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