Reputation: 3547
These are the two commands that I always use to get SQLite file from Android device to view and debug.
$ adb backup -noapk com.example.app
$ dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf -
However, I don't why now I cannot use it. the back.ab I got from the first command will be 41 bytes and the second command will not work. The commands still work for other apps though. Only problem with this app I am working with.
I have tried a solution in this link but it's the same. I vaguely remember that I face this problem before because I am doing something wrong like typo in package name. This time I double check and my package name is correct.
Upvotes: 2
Views: 3107
Reputation: 3547
It turned out that this problem caused by having android:allowBackup="false"
in AndroidManifest.xml
, which I added to stop Auto Backup for Apps while I'm developing my app.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app">
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
So just remove the line and the $adb backup
will work again
Upvotes: 3