8

Does the command:

adb backup -all -f backup.ab

include contacts in the backup?

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
user2212461
  • 183
  • 1
  • 1
  • 5

4 Answers4

4

No, it would not backup Contacts. Yes, it would backup Contacts.

Confused, eh!

Yes, it would backup Contacts.

See this question: Backup/Restore SMS/MMS via ADB on a non-rooted device? The author of it was able to backup contacts. It was later revealed that the device on which the backup was performed ran Android 4.1.2. It was a bizarre revelation for me that the backup succeeded.

No, it would not backup Contacts.

As per the Manifest mentioned here for default Contacts Provider app in Android versions (in series), for Jelly Bean and above Android versions the ADB backup for Contacts Provider/Storage would be denied by system, and hence your contacts wouldn't be backed up.

It's a mere flag android:allowBackup="false" that's the cause of backup denial. See my answers here and here to know more about that flag.

Firelord
  • 25,084
  • 20
  • 124
  • 286
2

Yes, it does. You can get it via:

adb pull /data/data/com.android.providers.contacts/databases/contacts2.db
geffchang
  • 17,565
  • 18
  • 57
  • 73
  • 3
    But adb pull is not adb backup! Also, your command would not work for a device running the kernel in secure mode. – Firelord Aug 09 '15 at 21:09
  • It is most useful knowing exactly where to fetch the contacts from in their raw format. Thanks. – samus Jan 23 '17 at 02:09
1

Yes it should include the contacts. Your syntax appears incorrect though. It should be adb backup -all -f backup.ab rather than adb backup .all -f backup.ab Also the -f backup.ab is optional as that is the default.

djh
  • 21
  • 2
0

It doesn't seem to be the case. I tried with both the following commands

adb backup -all -apk -shared -nosystem -f adb_backup.ab
adb backup -all -apk -shared -system -f adb_backup.ab

and neither my photos, SMS nor contacts were backed-up.

  • 2
    I don't know about photos but you're right about SMS and Contacts not getting backed up. See my answer here to know the reason. Also, on which Android version did you test these commands? – Firelord Aug 09 '15 at 21:41