By Lucky

2015-07-27 10:25:56 8 Comments

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.


@Lucky 2015-07-27 10:25:56

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.

@Firelord 2015-07-27 11:00:06

Did you check whether a bug has been filed? Your answer is at odds with this question (for Kitkat though).

@Lucky 2015-07-27 11:23:32

@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. :)

@Izzy 2015-07-27 12:42:36

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).

@Firelord 2015-07-27 12:59:34

@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. :)

@Izzy 2015-07-27 13:02:07

Might be – still makes things a bit more complicated :) Just saying, no criticizing intended!

@Vladimir G. Ivanovic 2015-12-13 04:54:27

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).

@Lucky 2015-12-13 05:39:34

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.

@Vladimir G. Ivanovic 2016-07-13 05:41:47

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.

Related Questions

Sponsored Content

1 Answered Questions

[SOLVED] Is it possibile to extract individual files from a .ab backup file?

1 Answered Questions

Sponsored Content