Android command line tool (2) -- ddms

Source: Internet
Author: User

DDMS stands for Dalvik Debug Monitor Service, which has powerful functions. It can be used to capture the screen of connected devices or virtual machines and view the heap and thread information of running processes, you can simulate phone calls, send text messages, and virtual location settings, including file browsers and memory allocation tracking. This article continues with the official documentation to introduce some usage of DDMS. (DDMS started through Eclipse)



Start DDMS

There are two startup methods:

First, go to the tools directory in the sdk installation path through the command line to start the sdk;

In Eclipse, click Window> Open Perspective> Other> DDMS.

It is worth noting that there is a difference between the two methods to start DDMS, but the overall function is similar. You can compare it. (It is started through the command line .)


Usage (DDMS started in Eclipse is used as an example ):


View the heap usage of a process:

1. In the left-side view of DDMS, select the process to be viewed.

2. Click the Update Heap button above.

3. Click Heap on the right to view the memory size and memory size allocated by the process.

4. You can also click type in the list below to view Allocation count per size.


View the real-time memory allocation of objects:

1. In the left-side view of DDMS, select the process to be viewed.

2. On the Allocation Tracker tab on the right, click Start Tracking to Start tracing object memory Allocation.

3. Click get allocations to view the objects generated since the start tracking button is clicked. The details include the classes and threads of the objects. Click get allocations to view the new object.

4. Click Stop tracking to stop tracking.

5. Click an item in the list to view more detailed information, such as the class, method, and file of the object.


Screen capture:

You can click the screen capture button above the left-side view of DDM to display the screen of the current device or simulator.


Use a file browser:

Click file explorer on the right side to view, delete, and copy files from a device or simulator. In addition, you can copy files on the device or simulator by clicking pull file, and transfer files to the device by clicking the push file button.


View the thread information of a process:

You can select a process of interest in the attempt on the left of ddms, and click Update threads on the top to view the thread information on the threads tab on the right, including the thread ID, status, name, and other information.


Method profiling)

Function analysis allows you to view the number of calls and execution time of a function within a certain period of time.

In addition, the function profiling function is not supported by Android. Android and earlier versions must have an SD card and the program has the write permission to the SD card, android2.2 and later versions are not required


Use logcat

You can use the log class in a program to print information to logcat.


Simulate mobile phone operations and positioning

You can use the Emulator Control tab of DDMS to send text messages, make phone calls, and set the longitude and latitude.


For more information, see:

Http://developer.android.com/guide/developing/debugging/ddms.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.