I wanted to backup all the apps and the data of my phone, before I do some hazardous things on it.

I have run:

./adb backup -f /mydir/backup.file -apk -obb -shared -all -system

But the resulting file is ridiculously small (549 bytes), so I know it has not backuped everything.

What I am doing wrong ?

  • Hard to say (but yes, I'd expect a file of several GB, with all your eggs in one basket). You could try to adb logcat -v time | tee logcat.txt (Ctrl-C when current timestamp is reached) and see if you find some pointers. Were there any errors shown? Have you been asked to confirm the backup on your device?
    – Izzy
    May 20 '17 at 23:15
  • Yes I have been asked for confirmation on my device, as well as a password for encyption. I'm gonna try logcat. May 20 '17 at 23:40
  • @Izzy no obvious clue in logcat... it is not even mentionning the backup operation... May 20 '17 at 23:59
  • That's strange. As you've entered a password for encryption, those 549 bytes are obviously nothing but the (encrypted and compressed) backup header (without password and for a single app, that's usually 41 bytes). No idea what goes wrong there, but maybe you try to keep the ball low and just backup a single user app first, to see whether that works? E.g. adb backup -f backup.ab -apk com.foobar.app (replacing com.foobar.app with the package name of one user app you've installed)?
    – Izzy
    May 21 '17 at 10:06
  • @Izzy that worked much better. I will try to find which combination of flags makes the backup fail. ( I have not tried the restore yet, but the file is several MByte big, that's much better) May 22 '17 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.