Android-ddms-debugger and monitoring tools

Source: Internet
Author: User

The full name of ddms is Dalvik debug monitor service,

  • Port forwarding service, which can make ddms a proxy for IDE and devices
  • Mobile phone device Screen
  • Device thread and stack information
  • Log Information
  • Process Information
  • Broadcast status information
  • Analog call
  • Receive SMS
  • Virtual geographic coordinates
  • RF status information
  • Others
How to start ddms

Prerequisites: Start the Android-SDK simulator or connect to a mobile device;

 

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. (1)
  2. Start ddms during the eclipes debugging process. The interface (2) in eclipes is as follows:

Figure 1

Figure 2

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" (for example). Here you can view the details of all the terminals connected to ddms, and the app process running on each terminal. the rightmost side of each process corresponds to the port connected to the debugger. Because Android is an operating platform 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 devices Panel (for example), 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 enable the test terminal to 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: simulates the voice quality and signal connection mode with options.
Telephony actions: simulates the call and sends the SMS to the test terminal.
Location Control: simulates geographical coordinates or simulates Dynamic Route coordinate changes and displays preset geographical identifiers. You can use the following three 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 debug the 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:

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.