Is there a generalized man page or documentation for the Android adb shell dumpsys [service]
command? I do not mean this as this does not seem to give specifics about the output of specific services, e.g. adb shell dumpsys backup
I've read through this question with regards to the dumpsys command in general, but it seems there is no link to any generalized documentation or man page. This answer stems from the user reading through the source C code and describing their observations, while this answer seems to be just some specific use-cases that the user has found helpful. One comment even asks
Is this from a document somewhere or just your own experimentation?
Without a reply.
In particular, I came to the previously linked question based on the fact that I was not sure what I was looking at from the output of adb shell dumpsys backup
.
The Android docs state:
To look up backup tokens, run
adb shell dumpsys backup
. The token is the hexadecimal string following the labels Ancestral: and Current:. The ancestral token refers to the backup dataset that was used to restore the device when it was initially setup (with the device-setup wizard). The current token refers to the device's current backup dataset (the dataset that the device is currently sending its backup data to).
A truncated version of my output is:
Backup Manager is enabled / provisioned / not pending init
Auto-restore is enabled
Last backup pass started: 0 (now = 1575271089047)
next scheduled: 1575281388106
Transport whitelist:
android/com.android.internal.backup.LocalTransportService
com.google.android.gms/.backup.component.D2dTransportService
com.google.android.gms/.backup.BackupTransportService
Available transports:
android/com.android.internal.backup.LocalTransport
destination: Backing up to debug-only private cache
intent: null
* com.google.android.gms/.backup.BackupTransportService
destination: *****@gmail.com
intent: Intent { cmp=com.google.android.gms/.backup.SetBackupAccountActivity }
@pm@ - 3794 state bytes
com.google.android.dialer - 124 state bytes
com.google.android.videos - 72 state bytes
com.android.providers.settings - 76 state bytes
...
Pending init: 0
Ancestral: 0
Current: 39b423cbcb6862e5
Participants:
uid: 1000
com.android.providers.settings
android
uid: 1027
com.android.nfc
uid: 10004
com.android.providers.userdictionary
com.android.providers.blockednumber
com.android.calllogbackup
...
Ancestral packages: none
Ever backed up: 66
com.android.cellbroadcastreceiver
com.allrecipes.spinner.free
com.google.android.youtube
...
Pending key/value backup: 47
BackupRequest{pkg=com.google.android.dialer}
BackupRequest{pkg=com.google.android.videos}
BackupRequest{pkg=com.android.cellbroadcastreceiver}
...
Full backup queue:68
0 : com.jb.gokeyboard.langpack.ja
0 : com.Splitwise.SplitwiseMobile
1575154802432 : com.google.android.gsf.login
1575156372751 : com.google.android.backuptransport
1575159051168 : com.google.android.ext.services
...
Backup Manager is enabled / provisioned / not pending init
Auto-restore is enabled
Last backup pass started: 0 (now = 1575271089047)
next scheduled: 1575281388106
Transport whitelist:
android/com.android.internal.backup.LocalTransportService
com.google.android.gms/.backup.component.D2dTransportService
com.google.android.gms/.backup.BackupTransportService
Available transports:
android/com.android.internal.backup.LocalTransport
destination: Backing up to debug-only private cache
intent: null
* com.google.android.gms/.backup.BackupTransportService
destination: *****@gmail.com
intent: Intent { cmp=com.google.android.gms/.backup.SetBackupAccountActivity }
@pm@ - 3794 state bytes
com.google.android.dialer - 124 state bytes
com.google.android.videos - 72 state bytes
com.android.providers.settings - 76 state bytes
...
Pending init: 0
Ancestral: 0
Current: 39b423cbcb6862e5
Participants:
uid: 1000
com.android.providers.settings
android
uid: 1027
com.android.nfc
uid: 10004
com.android.providers.userdictionary
com.android.providers.blockednumber
com.android.calllogbackup
...
Ancestral packages: none
Ever backed up: 66
com.android.cellbroadcastreceiver
com.allrecipes.spinner.free
com.google.android.youtube
...
Pending key/value backup: 47
BackupRequest{pkg=com.google.android.dialer}
BackupRequest{pkg=com.google.android.videos}
BackupRequest{pkg=com.android.cellbroadcastreceiver}
...
Full backup queue:68
0 : com.jb.gokeyboard.langpack.ja
0 : com.Splitwise.SplitwiseMobile
1575154802432 : com.google.android.gsf.login
1575156372751 : com.google.android.backuptransport
1575159051168 : com.google.android.ext.services
...
Backup Manager is enabled / provisioned / not pending init
Auto-restore is enabled
Last backup pass started: 0 (now = 1575271089047)
next scheduled: 1575281388106
Transport whitelist:
android/com.android.internal.backup.LocalTransportService
com.google.android.gms/.backup.component.D2dTransportService
com.google.android.gms/.backup.BackupTransportService
Available transports:
android/com.android.internal.backup.LocalTransport
destination: Backing up to debug-only private cache
intent: null
* com.google.android.gms/.backup.BackupTransportService
destination: *****@gmail.com
intent: Intent { cmp=com.google.android.gms/.backup.SetBackupAccountActivity }
@pm@ - 3794 state bytes
com.google.android.dialer - 124 state bytes
com.google.android.videos - 72 state bytes
com.android.providers.settings - 76 state bytes
...
Pending init: 0
Ancestral: 0
Current: 39b423cbcb6862e5
Participants:
uid: 1000
com.android.providers.settings
android
uid: 1027
com.android.nfc
uid: 10004
com.android.providers.userdictionary
com.android.providers.blockednumber
com.android.calllogbackup
...
Ancestral packages: none
Ever backed up: 66
com.android.cellbroadcastreceiver
com.allrecipes.spinner.free
com.google.android.youtube
...
Pending key/value backup: 47
BackupRequest{pkg=com.google.android.dialer}
BackupRequest{pkg=com.google.android.videos}
BackupRequest{pkg=com.android.cellbroadcastreceiver}
...
Full backup queue:68
0 : com.jb.gokeyboard.langpack.ja
0 : com.Splitwise.SplitwiseMobile
1575154802432 : com.google.android.gsf.login
1575156372751 : com.google.android.backuptransport
1575159051168 : com.google.android.ext.services
...
The parts mentioned in the quoted text above, seem to make sense, but there is a significant amount of additional information that I'm not sure what to do with. In particular, I was searching for a means to verify what was backed up and what was not, but with headings like "Participants, Ancestral packages, Ever backed up, Pending key/value backup, Full backup queue", I'm not sure what is and is not backed up.
I tried adb shell dumpsys backup -h
but this gives nothing helpful:
$ adb shell dumpsys backup -h
'dumpsys backup' optional arguments:
-h : this help text
a[gents] : dump information about defined backup agents
I am seeking an explanation of the output of adb shell dumpsys backup
and all its headers. Also, is there any documentation discussing this in more detail? Maybe there is none, and this is why people have resorted to reading through the source code in its place?
I was looking for the very same, without much luck. But I found a bunch of pieces which I'll glue together in an answer here – without the claim of completeness or „absolute correctness“: I'm not an Android dev, just an enthusiast (power) user. Find my sources at the end (Footnotes) and referred to from the snippets. I will go by the output of dumpsys backup
and comment what I found.
Backup Manager is enabled / provisioned / not pending init
Auto-restore is enabled
Last backup pass started: 0 (now = 1575271089047)
next scheduled: 1575281388106
This part should be rather clear. One can use bmgr enable 0|1
to (de)activate backup manager. When deactivated, no backups are taking place (unless triggered via adb backup
). Values in lines 3+4 are Unix timestamps, with the exception of the 0
which simply means no backup has been taken yet at all.
Transport whitelist:
android/com.android.internal.backup.LocalTransportService
com.google.android.gms/.backup.component.D2dTransportService
com.google.android.gms/.backup.BackupTransportService
These are system whitelisted transports ([2]
) – though the source does not explain what this means. They seem to correspond to the „available transports“ from the next block.
Available transports:
android/com.android.internal.backup.LocalTransport
destination: Backing up to debug-only private cache
intent: null
* com.google.android.gms/.backup.BackupTransportService
destination: *****@gmail.com
intent: Intent { cmp=com.google.android.gms/.backup.SetBackupAccountActivity }
@pm@ - 3794 state bytes
com.google.android.dialer - 124 state bytes
com.google.android.videos - 72 state bytes
com.android.providers.settings - 76 state bytes
...
List of transports available for backups. Google cloud's BackupTransportService
is default (marked by the *
), but requires an account set up on the device([1]
) (as does the device-to-device transport D2dTransportService
it seems to me). As I understand, one can change the default using bmgr transport <transportName>
– and run a backup using bmgr run
(for all pending backups to default transport?).
Note that this list corresponds to the output of bmgr list transports
. Local backups (LocalTransport
) seems to be what gets triggered by adb backup
.
Pending init: 0
Ancestral: 0
Current: 39b423cbcb6862e5
Quoting from source [5]
:
To look up backup tokens, run
adb shell dumpsys backup
. The token is the hexidecimal string following the labelsAncestral:
andCurrent:
. The ancestral token refers to the backup dataset that was used to restore the device when it was initially setup (with the device-setup wizard). The current token refers to the device's current backup dataset (the dataset that the device is currently sending its backup data to).
This should also explain what „Ancestral packages“ (further down in the output) means.
Participants:
uid: 1000
com.android.providers.settings
android
uid: 1027
com.android.nfc
uid: 10004
com.android.providers.userdictionary
com.android.providers.blockednumber
com.android.calllogbackup
...
Participants are applications that can request backup, sorted by AID. ([1]
)
Ancestral packages: none
For Ancestral packages, please also see above. I don't know how this would look if there were any (but I assume similar to ever backed up
below); I myself run my Android devices „Google free“ (LineageOS, no Google Apps) and thus never used this part. Some more notes on these: they seem to come from a backup set that wasn't created on the same device (or at least not from the same „iteration“, i.e. if they came from the same physical device, it was since factory-reset). In line 481 of the [2]
source code we find the note:
The ancestral work profile corresponds to the profile that was used to restore to the callers profile.
Further, in the [3]
BackupManager reference:
The ancestral serial number will have a corresponding UserHandle if the device has a work profile that was restored from another work profile with serial number ancestralSerialNumber.
Finally, in the [4]
backup guide:
During the initial device setup wizard, the user is shown a list of available backup datasets and is asked which one to restore the data from. Whichever backup dataset is selected becomes the ancestral dataset for the device. The device can restore from either its own backups or the ancestral dataset. The device prioritize its own backup if backups from both sources are available. If the user didn't go through the device setup wizard, then the device can restore only from its own backups.
Ever backed up: 66
com.android.cellbroadcastreceiver
com.allrecipes.spinner.free
com.google.android.youtube
...
This seems pretty much self-explaining: the number and the list of apps that are already part of a backup set.
Pending key/value backup: 47
BackupRequest{pkg=com.google.android.dialer}
BackupRequest{pkg=com.google.android.videos}
BackupRequest{pkg=com.android.cellbroadcastreceiver}
...
I found no reference on this, but a good guess from the above is these are „Participants“ having requested a backup, and their requests have not yet been processed.
Full backup queue:68
0 : com.jb.gokeyboard.langpack.ja
0 : com.Splitwise.SplitwiseMobile
1575154802432 : com.google.android.gsf.login
1575156372751 : com.google.android.backuptransport
1575159051168 : com.google.android.ext.services
...
On this [1]
comments it is a list of Last backup : package name
(with Last backup
most likely again being a Unix timestamp or 0
when it was never backed up yet). On device, the backup queue is located on-device in /data/backup
.
I hope I was able to shed some light, and above information is useful to you (and others). You might find out more details going by the sources mentioned below – especially when scanning the source code ([2]
), I might have missed some.
BackupManagerService.java