Partager via


Debug Class

Definition

Provides various debugging methods for Android applications, including tracing and allocation counts.

[Android.Runtime.Register("android/os/Debug", DoNotGenerateAcw=true)]
public sealed class Debug : Java.Lang.Object
[<Android.Runtime.Register("android/os/Debug", DoNotGenerateAcw=true)>]
type Debug = class
    inherit Object
Inheritance
Debug
Attributes

Remarks

Provides various debugging methods for Android applications, including tracing and allocation counts.

<strong>Logging Trace Files</strong>

Debug can create log files that give details about an application, such as a call stack and start/stop times for any running methods. See Inspect Trace Logs with Traceview for information about reading trace files. To start logging trace files, call one of the startMethodTracing() methods. To stop tracing, call #stopMethodTracing().

Java documentation for android.os.Debug.

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.

Fields

ShowClassloader
ShowFullDetail
Obsolete.

Flags for printLoadedClasses().

ShowInitialized
TraceCountAllocs

Flags for startMethodTracing().

Properties

BinderDeathObjectCount

Returns the number of death notification links to Binder objects that exist in the current process.

BinderLocalObjectCount

Returns the number of active local Binder objects that exist in the current process.

BinderProxyObjectCount

Returns the number of references to remote proxy Binder objects that exist in the current process.

BinderReceivedTransactions

Returns the number of received transactions from the binder driver.

BinderSentTransactions

Returns the number of sent transactions from this process.

Class

Returns the runtime class of this Object.

(Inherited from Object)
GlobalAllocCount

Returns the global count of objects allocated by the runtime between a #startAllocCounting() start and #stopAllocCounting() stop.

GlobalAllocSize

Returns the global size, in bytes, of objects allocated by the runtime between a #startAllocCounting() start and #stopAllocCounting() stop.

GlobalClassInitCount

Returns the number of classes successfully initialized (ie those that executed without throwing an exception) between a #startAllocCounting() start and #stopAllocCounting() stop.

GlobalClassInitTime

Returns the time spent successfully initializing classes between a #startAllocCounting() start and #stopAllocCounting() stop.

GlobalExternalAllocCount
Obsolete.

This method exists for compatibility and always returns 0.

GlobalExternalAllocSize
Obsolete.

This method exists for compatibility and always returns 0.

GlobalExternalFreedCount
Obsolete.

This method exists for compatibility and always returns 0.

GlobalExternalFreedSize
Obsolete.

This method exists for compatibility and has no effect.

GlobalFreedCount

Returns the global count of objects freed by the runtime between a #startAllocCounting() start and #stopAllocCounting() stop.

GlobalFreedSize

Returns the global size, in bytes, of objects freed by the runtime between a #startAllocCounting() start and #stopAllocCounting() stop.

GlobalGcInvocationCount

Returns the number of non-concurrent GC invocations between a #startAllocCounting() start and #stopAllocCounting() stop.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsDebuggerConnected

Determine if a debugger is currently attached.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
LoadedClassCount

Get the number of loaded classes.

NativeHeapAllocatedSize

Returns the amount of allocated memory in the native heap.

NativeHeapFreeSize

Returns the amount of free memory in the native heap.

NativeHeapSize

Returns the size of the native heap.

PeerReference (Inherited from Object)
Pss

Retrieves the PSS memory used by the process as given by the smaps.

RuntimeStats

Returns a map of the names/values of the runtime statistics that #getRuntimeStat(String) supports.

ThreadAllocCount

Returns the thread-local count of objects allocated by the runtime between a #startAllocCounting() start and #stopAllocCounting() stop.

ThreadAllocSize

Returns the thread-local size of objects allocated by the runtime between a #startAllocCounting() start and #stopAllocCounting() stop.

ThreadExternalAllocCount
Obsolete.

This method exists for compatibility and has no effect.

ThreadExternalAllocSize
Obsolete.

This method exists for compatibility and has no effect.

ThreadGcInvocationCount

Returns the number of thread-local non-concurrent GC invocations between a #startAllocCounting() start and #stopAllocCounting() stop.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

AttachJvmtiAgent(String, String, ClassLoader)

Attach a library as a jvmti agent to the current runtime, with the given classloader determining the library search path.

ChangeDebugPort(Int32)
Obsolete.

Change the JDWP port.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
DumpHprofData(String)

Dump "hprof" data to the specified file.

DumpHprofDataAsync(String)
DumpService(String, FileDescriptor, String[])

Get a debugging dump of a system service by name.

DumpServiceAsync(String, FileDescriptor, String[])
EnableEmulatorTraceOutput()

Enable "emulator traces", in which information about the current method is made available to the "emulator -trace" feature.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetMemoryInfo(Debug+MemoryInfo)

Retrieves information about this processes memory usages.

GetRuntimeStat(String)

Returns the value of a particular runtime statistic or null if no such runtime statistic exists.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
PrintLoadedClasses(DebugShow)

Dump a list of all currently loaded class to the log file.

ResetAllCounts()

Clears all the global and thread-local memory allocation counters.

ResetGlobalAllocCount()

Clears the global count of objects allocated.

ResetGlobalAllocSize()

Clears the global size of objects allocated.

ResetGlobalClassInitCount()

Clears the count of classes initialized.

ResetGlobalClassInitTime()

Clears the count of time spent initializing classes.

ResetGlobalExternalAllocCount()
Obsolete.

This method exists for compatibility and has no effect.

ResetGlobalExternalAllocSize()
Obsolete.

This method exists for compatibility and has no effect.

ResetGlobalExternalFreedCount()
Obsolete.

This method exists for compatibility and has no effect.

ResetGlobalExternalFreedSize()
Obsolete.

This method exists for compatibility and has no effect.

ResetGlobalFreedCount()

Clears the global count of objects freed.

ResetGlobalFreedSize()

Clears the global size of objects freed.

ResetGlobalGcInvocationCount()

Clears the count of non-concurrent GC invocations.

ResetThreadAllocCount()

Clears the thread-local count of objects allocated.

ResetThreadAllocSize()

Clears the thread-local count of objects allocated.

ResetThreadExternalAllocCount()
Obsolete.

This method exists for compatibility and has no effect.

ResetThreadExternalAllocSize()
Obsolete.

This method exists for compatibility and has no effect.

ResetThreadGcInvocationCount()

Clears the thread-local count of non-concurrent GC invocations.

SetAllocationLimit(Int32)
Obsolete.

Establish an object allocation limit in the current thread.

SetGlobalAllocationLimit(Int32)
Obsolete.

Establish a global object allocation limit.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
StartAllocCounting()
Obsolete.

Start counting the number and aggregate size of memory allocations.

StartMethodTracing()

Start method tracing with default log name and buffer size.

StartMethodTracing(String, Int32, DebugTraceOptions)

Start method tracing, specifying the trace log file name, the buffer size, and flags.

StartMethodTracing(String, Int32)

Start method tracing, specifying the trace log file name and the buffer size.

StartMethodTracing(String)

Start method tracing, specifying the trace log file path.

StartMethodTracingSampling(String, Int32, Int32)

Start sampling-based method tracing, specifying the trace log file name, the buffer size, and the sampling interval.

StartNativeTracing()

Enable qemu tracing.

StopAllocCounting()
Obsolete.

Stop counting the number and aggregate size of memory allocations.

StopMethodTracing()

Stop method tracing.

StopNativeTracing()

Stop qemu tracing.

ThreadCpuTimeNanos()

Get an indication of thread CPU usage.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WaitForDebugger()

Wait until a debugger attaches.

WaitingForDebugger()

Returns "true" if one or more threads is waiting for a debugger to attach.

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to