Reputation: 275
I like the idea to create backup without any other tools and without require root - so "adb backup" seems to be the perfect solution.
But for some strange reason it creates just almost empty backups for some apps.
The command I use is:
adb backup -f ${APP}.ab -apk -share -nosystem ${APP}
Around 50% of my apps are suffered. I can't see any rule. Neither this are just payed apps, nor it depends whether they are from playstore or FDroid. What can be the reason for that?
I use that one on my ubuntu linux machine: Android Debug Bridge version 1.0.39 Version 1:8.1.0+r23-5ubuntu2 Installed as /usr/lib/android-sdk/platform-tools/adb
Tested different parameters - no change.
I created a script that create backup for each user app (so skip these in priv-app and system folders). Maybe that is useful for others. A complete backup is not very usefull, as there is no command to restore a selection out of the backup - all or nothing. The script has two issues:
To create a list I used that command:
adb shell pm list packages -f | grep -v priv-app | grep -v '/vendor' | grep -v '/system' | rev | cut -d = -f 1 | rev | sort
Think I could find the reason. In each APK there is an AndroidManifest.xml file that can/must (?) have a setting: android:allowBackup
Whether to allow the application to participate in the backup and restore infrastructure. If this attribute is set to false, no backup or restore of the application will ever be performed, even by a full-system backup that would otherwise cause all application data to be saved via adb. The default value of this attribute is true.
Bummer! I think two ways to workaround that. Either change that on phone (which might be not possible or need root) or to manipulate that before installing it. It that will work I guess it has to repeat after each update.
Anyone has a solution? Are backups without root/google cloud possible?
Upvotes: 3
Views: 4446
Reputation: 171
I spend lots of time in finding a way to do it and can for sure say:
In 2023 with recent android versions (12 and 13) there is no way in getting app data backed up without root. Even the mentioned apktool method doesn't work because android uses signed apks now.
Even if you try to bypass this using a custom certificate/keystore you'll need to uninstall the original app and then the app data is most certainly gone.
Upvotes: 6
Reputation: 6160
You can follow these steps:
allowBackup
attribute in the AndroidManifest.xml
and set it to trueapktool
(this time with "b" option)adb
command you posted to perform the backupUpvotes: 1