Wednesday, April 5, 2017

5.0 lollipop - adb backup command on non-rooted device creates an empty backup file?


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.




Answer



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.



No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...