Adams This is a command line tool provided within Android, so it can be used to get information about
the system services.
So as you already know, there are a lot of system services in Android system, for example, activity
management, service package management service, window management service, Bluetooth management service
and etc..
So there is more than 100 system services in any Android system.
So when you work with system services, the dumps, this tool can help you a lot.
So it can provide you with the diagnostic information or the current state of the system services.
Let's dig deeper how this works.
So I have the emulator open here and if I need to find out all the system services which are running
in the emulator, I could use terms like for example, ITB cell service hyphen LL stands for to list
out all the services.
So it will show you all the services which are currently running in the emulator.
So you can see the Surface Fling DVT, which is an activity management service and a lot of them.
Right.
And if you want to know the latest or the current state of all the system services, then you could
maybe shell dumb systems.
This will output the entire logs of all the system services.
So simply giving ADB shell dumps will dump the entire status of all the system services.
So just show how big it is.
I will just dump it again to the text.
So I have opened the dump text here in the Visual Studio code we can see that it has dumped the status
of all the system.
Services so far still show all the system service and then show the status of each of them.
You can see there is around 84,634 lines of data.
So when you work with system services, you may not need to dump the entire status of all the system
services.
So you just need to dump the status of only one particular system service.
So to do that, what you could do is just pass the service name here, like in case if I need to dump
the activity management service, then I could simply give activity.
So activity is the name of the activity management service then.
Now I have opened it in area code.
There you can see now I have only activity management service related information and it's like around
6000 lines of code.
So this will show you all the information about the activities.
Let's take another example.
Let's take ADB shell dumps, disk stats.
So this dump will show you the information about the current disk capacity and its sizes.
So here you can see it just shows this much information and it shows 89%.
It is free.
And in that data partition and cache, this 89% is free and the system says 5% is free.
Let's take another example to dump the Bluetooth information to underscore manager.
I guess this is pretty big, but you can see all this information which shows the Bluetooth status and
all the information related to the Bluetooth.
Now let's dig a little bit more deeper into dumpsites.
So as we already know, this is basically a binary program which resides in the Android system.
Binary program is basically compiled from this dot CPP.
So you can find dumps stored CP under the native cmd folder.
So here you can see a lot of command line programs like a trace bug report.
So the dumps is one of them.
And the demo, this is pretty simple program, so you can see the system.
CP And it also has a header file and the main.
CP So the main CP does nothing.
We simply call dumps the stored CP and the dump system.
CP has this main method which will take all the arguments which you are parsing from the command line,
and it will first go through the argument and then it gets a handle to the service through the service
manager.
So as you might be already knowing, all the services within Android is registered under service manager.
So this program basically gets a handle to the service through the service manager.
And based on the command line or the arguments passed, it will execute the corresponding dump method
within the system services.
So all the system services within Android has a dump method.
So the dump method comes from binder.
So I'll just show you that to make it pretty clear if you simply search for public void dump method
within the services folder and you can see that all the system services has this dump, for example,
let's take Bluetooth manager as an example.
You can see that there is an overwritten method dump and this dump method is coming from the.
Binder, the binder class.
So all the systems are versus extends binder class as well.
So that's why we are overwriting it here.
And the data which you are seeing in the command line or in the export, the dump stat dumps this export,
that is nothing, but it's coming from here.
So maybe to prove that we could quickly check the Bluetooth status.
So in this case, it prints the Bluetooth status and all this information as shown here.
Right.
Let's quickly do one of the Bluetooth surveys and see whether it matches to this print.
Well, let's do the dumb of Bluetooth manager and put let's put it in the XRT so that we can check it
in visual code.
So now we have this dump, here it is just created.
So you can see here the Bluetooth status.
So this is nothing but this Bluetooth status which is rendered out from the dump method.
See, it has all these information Bluetooth status enabled.
True.
You can match it here.
The Bluetooth status enabled state is on the address.
It's showing this one and the name, this name and time since enabled.
So it's basically printing out the data from this dump method.
So all the system services like if you come back here and see all the system services has this dump
method, this is display manager service.
So it also has a dump method which will render all these things.
So dump internal will basically print all those details.
So to summarize, dump this command is used to get the status of the system services.
You could use the ADB shell dumps.
I can l do list down all the services and if you want the dump of everything, you could simply use
ADB shell dumps without any parameters.
And if you want it for a specific service, then you could just pass in the service name.
Here, each of the system service will have this dump method which is basically responsible to rent
the dump service data.
So.