15

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.

  • 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 Oct 3 '15 at 5:11
  • 1
    @jpaugh Try this answer android.stackexchange.com/q/83080/96277 which is specifically for KitKat. – Lucky Oct 3 '15 at 6:58
  • 1
    Much appreciated! – jpaugh Oct 5 '15 at 15:06
10

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.

  • 1
    Did you check whether a bug has been filed? Your answer is at odds with this question (for Kitkat though). – Firelord Jul 27 '15 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 Jul 27 '15 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 Jul 27 '15 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 Jul 27 '15 at 12:59
  • Might be – still makes things a bit more complicated :) Just saying, no criticizing intended! – Izzy Jul 27 '15 at 13:02
-1

On Marshmallow, setting (or using a) backup password worked for me, but I do not think these 0-byte files are due to a bug. Being able to bypass system encryption by just making a backup is a bug, a massive one.

Note that unlike unencrypted devices, physical access to an encrypted device does not compromise the device's data (provided the encryption is not faulty).

  • 3
    The word bug was from a post from XDA forum post. And this should be aa comment since it doesnot add anything other than what is already specified in my answer. – Lucky Dec 13 '15 at 5:39
  • I think it's important that people realize that allowing backups of an encrypted device without a password defeats the purpose of the encryption. Just saying. – Vladimir G. Ivanovic Jul 13 '16 at 5:41

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.