0

I tried command adb backup -f backup.ab -apk -shared -all /storage/emulated/0

Then I tried inspect with android backup extractor, it just backing up the APK data, while I expect it backups the entire data /storage/emulated/0 including Whatsapp data, DCIM, and so on.

  • What Android version is installed on your phone? – Robert Jul 14 '23 at 06:59
  • 1
    The last part of your command is wrong. You can not specify a path, instead adb backup expects there a packagename of the app you want to backup (but that is in conflict with the -all argument). Note that if you try to perform a backup for migration to a new phone adb backup may not restore app data on the new phone this is now limited to older apps on recent Android versions. – Robert Jul 14 '23 at 13:30
  • @Robert So the command shall I do is adb backup -f backup.ab -apk -shared /storage/emulated/0

    If I don't specify path, in this case /storage/emulated/0, will it backup the /storage/emulated/0?\

    – Muhammad Ikhwan Perwira Jul 14 '23 at 13:32
  • @Robert I don't really need APK backup, I only want perform backup anything that inside /storage/emulated/0 – Muhammad Ikhwan Perwira Jul 14 '23 at 13:33
  • 2
    adb exec-out "tar -c /storage/emulated/0 | gzip" > sdcard_backup.tar.gz https://android.stackexchange.com/a/233784/2241 Note that the crated gz file will be corrupt if there is output on stdout (e.g. because of error or warning messages by tar). So after creating the gz file make sure to test it on the PC. – Robert Jul 14 '23 at 13:49
  • @Robert As far as I know, that command will trying to create archive using tar but instead of storing to the android storage, it will stdout directly to the PC (CMIIW) so it will not make storage in android became full due to archive. But, do I need gzip? – Muhammad Ikhwan Perwira Jul 14 '23 at 13:53
  • 2
    gzip is to verify integrity, it simplifies detection of corruptions by exec-out merging stdout messages into the file stream. – Robert Jul 14 '23 at 13:59
  • @Robert thank you, I saw your answer in this post https://android.stackexchange.com/questions/225295/adb-pull-says-it-pulled-all-of-the-files-from-my-android-phone-into-my-windows-p#225304 but I don't know the difference. – Muhammad Ikhwan Perwira Jul 14 '23 at 14:01
  • @Robert I saw this worked, but I need to monitor logging of backup processing, I think I can pipeline it with tee command, what do you think? Instead of using > – Muhammad Ikhwan Perwira Jul 14 '23 at 14:44

0 Answers0