I'm a bit confused with output bellow and was hoping someone can help me to decipher it for me)

 backup [-f FILE] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all] [-system|-nosystem] [PACKAGE...]
     write an archive of the device's data to FILE [default=backup.adb]
     package list optional if -all/-shared are supplied
     -apk/-noapk: do/don't back up .apk files (default -noapk)
     -obb/-noobb: do/don't back up .obb files (default -noobb)
     -shared|-noshared: do/don't back up shared storage (default -noshared)
     -all: back up all installed applications
     -system|-nosystem: include system apps in -all (default -system)
 restore FILE             restore device contents from FILE

My goal is very simple here; I'm about to perform factory reset and would like to take a backup of my phone, so I can restore my phone as it is now (before factory reset) (what is .obb files??)

Would following help me accomplish my goal or do I need something else like -all?

adb backup -f 05102017 -shared -nosystem

Please advise.

  • Just for curiosity: what good is a factory reset when doing a full restore afterwards, bringing everything back (except the things that backup doesn't cover, like SMS)? From a full backup you only can do a full restore (except for some tricks you only can do with root). So wouldn't you rather prefer separate backup packages for a selective restore? If so, you might wish to take a look at my tool Adebar, which a.o. would generate the necessary scripts for that. And: .obb is Opaque Binary Blob. – Izzy May 11 '17 at 8:52
  • @Izzy my boot-loader is unlocked, and I want to re-lock it and in order for that to happen, factory reset would be performed cleaning up my phone and I'd like to get back to same state as I am now (just with locked boot-loader), I wish to use native tools only, such as adb. – alexus May 11 '17 at 14:09
  • AFAIK a factory-reset is only performed on unlocking the bootloader (as otherwise an unauthorized could gain access to your data that way), but not on re-locking it. OK, got the idea – never wrong to have a backup, especially before operations like that :) PS: Note that such a backup would include SD card contents as well (which then also would be restored), so the archive can get quite big. – Izzy May 11 '17 at 14:11
  • 1
    @Izzy, that's not true as of now factory reset is required on re-locking as well. I don't have /sdcard in my phone (only internal memory). – alexus May 11 '17 at 14:13
  • 1
    First time I hear that – but thanks for the detail. They always invent new craziness… What does "as of now" refer to? A specific device, or a specific Android version? – Izzy May 11 '17 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.