"Invalid file format" from device extracted * .db file in Nexus 4 - Android 5.1.1

I am learning Android development. And I always get this error when opening the displayed database file from the device: "Invalid file format"

I use these commands to pull

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 a text editor, I can of course read the contents with special characters. But sqliteBrowser cannot read it.

+1
android sqlite3 pull
Oct 24 '15 at 9:40
source share
1 answer

I had the same issue with Android 4.0, although I used ubuntu 16.04 and an SQL browser instead.

I found only one way I could access my phone’s unconnected file system, and finally I was able to 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" 

exactly, you can check if there is a file

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

if you do not know the exact name of your package, then

 adb shell 'pm list packages -f' 

run SSHDroid

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

Configure SSHDroid

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

FileZilla File Manager

set /mnt/sdcard as the default remote directory

set default remote directory

and connect to the phone via SFTP

your phone's file system in FileZilla

0
Jan 08 '17 at 13:48 on
source share



All Articles