Wednesday, November 22, 2017

adb - Why is my Android not restoring the app data from its Google Drive backup?


I'm testing a new version of our app that now supports Android Auto Backup (by targeting API over 23).


I've managed to get the system to back up the app's data by leaving it overnight (two nights), but when I uninstalled the app and installed it again, it didn't restore the data from the backup.


However, I can still see the backup for the app under Settings > System > Backup > App data > [appname] and that it was last backed up yesterday.


I first re-installed the app from an apk downloaded to the device. Would this not trigger the restore like installing from Google Play or over adb should?


I've tried uninstalling again and installing over adb, but it still doesn't restore the data.



Is there a way to force it to restore the data from the backup?



Answer



adb shell bmgr restore


Source


Additional inputs from OP incorporated from comments



It appears that the reason it didn't restore automatically in my case was that there were many different devices backed up to the same Google Account, and it didn't know which "set" to use. I got a list of "sets" with the command adb shell bmgr list sets and could then use your command with the desired set like this: adb shell bmgr restore .



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