How to Use Android ddms?

Source: Internet
Author: User

The full name of ddms is Dalvik debug monitor service, which provides us with a screenshot for the test device, for example, view running threads and heap information, logcat, broadcast status information, analog call, receive SMS, and virtual geographic coordinates for specific processes.

How to start ddms

The ddms tool is stored in the SDK-tools/path. The method for starting ddms is as follows:

    1. Double-click ddms. BAT to run the task;
    2. Debug on elasticsearchProgramStart ddms. The interface in ES is as follows:

      Select "other". The interface is as follows:

      Double-click ddms to start it.

Ddms has the same effect on emulator and external test machine. If the system detects that they (VMS) run simultaneously, ddms points to emulator by default. The operations after the above two types of startup are somewhat different. We recommend that you try them separately.

How ddms works

Ddms sets up the link between the IDE and the test terminal (emulator or connected device). They apply their independent ports to listen to the information of the debugger. ddms can monitor the connection of the test terminal in real time. When a new test terminal is connected, ddms captures the terminal ID and establishes a debugger through ADB to send commands to the test terminal.

The port used by ddms to listen to the app process on the first terminal is 8600, and the app process is allocated 8601. If there are more terminals or more app processes, and so on. Ddms receives commands from all terminals through port 8700 ("base port.

The following describes some ddms functions of devices through GUI.

In the upper left corner of the GUI, you can see the Panel labeled "devices". Here, you can view the details of all the terminals connected to ddms, as well as the app processes running on each terminal, the rightmost side of each process corresponds to the port connected to the debugger. Because Android is developed based on the Linux kernel, it also retains the unique process ID in Linux, which is between the process name and port number.

In the upper-right corner of the Panel, there are a row of important buttons: debug the selected process, update threads, update heap, stop process, and screenshot.

Emulator Control

some functions of this panel can easily make the test terminal simulate some interactive functions of a real mobile phone, such as answering a call and simulating various network conditions based on the options, simulate receiving SMS messages and sending virtual address coordinates to test the GPS function.

telephony status: use the option to simulate the speech quality and signal connection mode.
telephony actions: receives and sends SMS messages to the test terminal.
location control: simulates geographical coordinates or dynamic route coordinate changes, and displays preset geographical IDs, you can use the following methods:

    • Manual: manually send two-dimensional latitude and longitude coordinates to the terminal.
    • GPX: The GPX file is used to import the sequence to dynamically change the geographical coordinates, so as to simulate the number of GPS changes during the process.
    • Kml: import a unique geographical identifier through the kml file and display it on the test terminal dynamically based on the changed geographical coordinates.
Threads, heap, file exporler


These items are also frequently used in other development tools, which are not described in detail. You can use file exporler to view files in the android simulator and conveniently import/export files.

Locate and console


Locate: displays the output debugging information. For details, see how to call the trial program in Android ?;
Console: The information output by the android simulator, and information such as loading programs;

Use ddms to send SMS messages. The procedure is as follows:

Enter the following content in emulator control \ telephony actions:

After clicking send, open messaging in the android simulator and you will see the following text message:

Click new SMS to view the SMS details:

Chinese characters are garbled. In future development, we must pay attention to Chinese characters.

Summary

ddms is the best debugging tool for our developers. It will be indispensable to everyone engaged in Android development.

Related Article

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.