Skip to main content
2 of 2
clarified title
Andrew T.
  • 16.5k
  • 10
  • 76
  • 127

Manually-modified ADB backup file cannot be restored on a different device

While there are tons of posts about ADB, I think we can all agree it is an elusive beast. Therefore asking if anyone can shed some light on the following:

The objective is to backup data from an app on device #1, change some database data in the app's database file stored in root/data/data/com.AppName.../apps/db, repackage the changes into an .ab and restore it to device #2 which will have the same App installed.

I have managed to create a .ab via adb backup (without .apk), have manipulated the db data after unpacking it from the .ab and have packed everything back into a .ab ready for restore to a new target device.

However, the restore does not yield any change on the new target device where the app has been pre-installed. This post seems to suggest that the app has to be installed via adb in order to get the data loaded.... but I'm not sure I'm understanding that.

I do have a copy of the .apk for the app which I could point to the mentioned restore script, but just not sure if that's the thing to do.

One more note is that I am working with unrooted devices. While I can see how adb backup could easily have read permission to app data, I never understood whether adb restore has permission by default to write app data to its destination under /root/data/data.

Sorry for the long post but just trying to be clear.

Thanks for any thoughts!