Service.Dump(FileDescriptor, PrintWriter, String[]) Method

Definition

Print the Service's state into the given stream.

[Android.Runtime.Register("dump", "(Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V", "GetDump_Ljava_io_FileDescriptor_Ljava_io_PrintWriter_arrayLjava_lang_String_Handler")]
protected virtual void Dump(Java.IO.FileDescriptor? fd, Java.IO.PrintWriter? writer, string[]? args);
[<Android.Runtime.Register("dump", "(Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V", "GetDump_Ljava_io_FileDescriptor_Ljava_io_PrintWriter_arrayLjava_lang_String_Handler")>]
abstract member Dump : Java.IO.FileDescriptor * Java.IO.PrintWriter * string[] -> unit
override this.Dump : Java.IO.FileDescriptor * Java.IO.PrintWriter * string[] -> unit

Parameters

fd
FileDescriptor

FileDescriptor: The raw file descriptor that the dump is being sent to.

writer
PrintWriter

PrintWriter: The PrintWriter to which you should dump your state. This will be closed for you after you return.

args
String[]

String: additional arguments to the dump request.

Attributes

Remarks

Print the Service's state into the given stream. This gets invoked if you run "adb shell dumpsys activity service <yourservicename>" (note that for this command to work, the service must be running, and you must specify a fully-qualified service name). This is distinct from "dumpsys <servicename>", which only works for named system services and which invokes the IBinder.dump method on the IBinder interface registered with ServiceManager.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-03 UTC.

Android reference for android.app.Service.dump.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to