0

I wanted to backup all the apps and the data of my phone, before I do some hazardous things on it.

I have run:

./adb backup -f /mydir/backup.file -apk -obb -shared -all -system

But the resulting file is ridiculously small (549 bytes), so I know it has not backuped everything.

What I am doing wrong ?

  • Hard to say (but yes, I'd expect a file of several GB, with all your eggs in one basket). You could try to adb logcat -v time | tee logcat.txt (Ctrl-C when current timestamp is reached) and see if you find some pointers. Were there any errors shown? Have you been asked to confirm the backup on your device? – Izzy May 20 '17 at 23:15
  • Yes I have been asked for confirmation on my device, as well as a password for encyption. I'm gonna try logcat. – Stephane Rolland May 20 '17 at 23:40
  • @Izzy no obvious clue in logcat... it is not even mentionning the backup operation... – Stephane Rolland May 20 '17 at 23:59
  • That's strange. As you've entered a password for encryption, those 549 bytes are obviously nothing but the (encrypted and compressed) backup header (without password and for a single app, that's usually 41 bytes). No idea what goes wrong there, but maybe you try to keep the ball low and just backup a single user app first, to see whether that works? E.g. adb backup -f backup.ab -apk com.foobar.app (replacing com.foobar.app with the package name of one user app you've installed)? – Izzy May 21 '17 at 10:06
  • @Izzy that worked much better. I will try to find which combination of flags makes the backup fail. ( I have not tried the restore yet, but the file is several MByte big, that's much better) – Stephane Rolland May 22 '17 at 15:27
  • Start with skipping -system (what do you want with the system .apks?) and -shared (SD card content you can copy separately). I'd recommend a "complete" backup (APK+data) from all your apps (one backup file per app – my little tool Adebar can help you with that as it e.g. creates the script for it), data-only backups from system apps (Adebar's script include that), and the "shared" you can do separately by simply copying the SD card. Leaves the -obb I forgot to integrate with Adebar – but you can "RegEx-Replace" that into the scripts). – Izzy May 22 '17 at 15:34
  • maybe try adb of an older version? https://android.stackexchange.com/questions/83080/adb-backup-creates-0-byte-file-prompts-for-current-backup-password-even-though – Steven Nov 14 '17 at 15:51

0 Answers0