18

I recently tried to backup my Motorola Moto G2 XT1068 phone running Lollipop 5.0.1 and after connecting it over USB with usb-debugging ON and I ran the adb backup command to backup my device completely and this question Full backup of non-rooted devices and the solution guided me. However running the following adb command,

adb backup -apk -shared -all -system -f D:/backup.ab

din't work in my case. The command instructed me to Unlock my device and confirm the backup operation. However doing so displayed the Backup started and Backup completed toast message back to back in just one second duration. And obviously the backup.ab file generated too was an empty 0kb file.

Removing and changing the parameter din't help either.

2
  • 3
    I had a similar problem on a 4.4.2 device, but your solution does not work for some reason... although it had worked before.. curious.
    – jpaugh
    Commented Oct 3, 2015 at 5:11
  • 1
    @jpaugh Try this answer android.stackexchange.com/q/83080/96277 which is specifically for KitKat.
    – Lucky
    Commented Oct 3, 2015 at 6:58

1 Answer 1

14

The workaround was to set the desktop backup password under Developer settings. It seems there is a bug in backup process. If you didn't set a desktop backup password under the developer options settings the above problems occur and your backup will eventually be incomplete(empty backup file). However, I couldn't find an official source for this bug report that setting the desktop backup password solves adb backup issue.

Got this information based on the XDA Forum [GUIDE] Full Phone Backup without Unlock or Root

Note: There seems to be a bug in which backup and restore operations will fail unless a desktop backup password is set under Developer Options. It will not work with a blank password.

After I set my desktop backup password under

Settings > Developer Options > Desktop backup password

adb backup -apk -shared -all -f D:/backup.ab

I am now able to run the above adb backup commands successfully. Note that I left the -system parameter as it is default one and the backup.ab file is almost 6GB now.

5
  • 1
    Did you check whether a bug has been filed? Your answer is at odds with this question (for Kitkat though).
    – Firelord
    Commented Jul 27, 2015 at 11:00
  • @Firelord No I couldn't find a bug reported on this issue. But I don't remember encrypting or set my desktop backup password earlier. I input 1234 in current password field and luckily it accepted. :)
    – Lucky
    Commented Jul 27, 2015 at 11:23
  • 2
    Good to have this, so thanks for sharing – but it's a work-around at best (not a "solution"). Sometimes one needs to have the backups without password encryption (e.g. to convert the .ab file to a .tar for investigation).
    – Izzy
    Commented Jul 27, 2015 at 12:42
  • 2
    @Izzy But Android Backup Extractor can convert the .ab into .tar even if the file is encrypted with a password. Of course, you've to supply the password during conversion. :)
    – Firelord
    Commented Jul 27, 2015 at 12:59
  • Might be – still makes things a bit more complicated :) Just saying, no criticizing intended!
    – Izzy
    Commented Jul 27, 2015 at 13:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .