Android Debugging Tools Ddms use of the detailed

Source: Internet
Author: User

specifically visible http://developer.android.com/tools/debugging/ddms.html. Ddms a bridge for the IDE and Emultor, the real Android device. Developers can see the process running on the target machine/out-of-the-box status through DDMS, can be Android screen to the development machine, can see the heap information of the process, can view the Logcat information, can see the process allocated memory situation, can be like the target machine to send text messages and call, can Send geolocation information to developers like Android. You can debug a process like GDB attach. The full version of DDMS is available under the SDK Tools directory, and can be run directly. The following is an example of Eclipse's DDMS perspective, which provides a brief introduction to DDMS functionality.

Like Debug,java's perspective, after installing ADT there will be a DDMS perspective, open.

after opening the window for,

The Device window lists all the processes in the emulator, and the upper-right corner of the row buttons are: Debug a process, update a process, update the process stack information, stop a process, and the last Picture button to crawl Android's current screen.

When you select a process and press the Debug process button, you can debug at the source level if there is code for the process in eclipse. A bit like gdb attach. The picture Grab button is also very useful to bring the current Android display desktop to your machine.

The window on the right has the threads, heap, File Explorer tab. Displays thread statistics, stack information, and Android file system, respectively.

File Explorer is useful for uploading files to an Android phone, or downloading them from a mobile phone or deleting them. When the File Explorer tab is selected, press the three buttons below to upload, download, and delete your Android phone's filesystem.

Emulator control is also very important, through which it can send text messages like a phone, call, has updated the phone location information.

Summarize:

Eclipse ADT currently offers DDMS features that are only a fraction of the real DDMS, and you can use all of the features directly using the DDMS under Tools. One of the features that looks at the memory allocation of a process is more useful.


DDMS Full Name: Dalvik Debug Monitor Service
One, the role of DDMS it provides screenshots, view thread and heap information, LOGCAT, process, broadcast status information, analog call calls and SMS, virtual geographic coordinates and so on.


Two, Ddms how to work 1, each Android application runs in a Dalvik virtual machine instance, and each virtual machine instance is a separate process space. The threading mechanism of virtual machines, memory allocation and management, mutexes, etc. are all dependent on the underlying operating system. All Android apps have threads that correspond to one Linux thread, so virtual machines can rely more on the operating system's thread scheduling and management mechanisms.
2,DDMS The role of an intermediary between the IDE and the device or emulator.
A Device monitoring service is established between the 3,DDMS and ADB to monitor the device when it starts. When the device is disconnected or linked, the service notifies DDMS.
4, when a device is linked, a VM monitoring service is established between DDSM and ADB to monitor the virtual machine on the device.
5, establish a link with the debugger of the virtual machine on the device through ADB deamon, so that Ddms starts to talk to the virtual machine.

three, Port 1, for each virtual machine on the device debugger, DDMS will open a listening port. The port starts at 8600.
2,8700 Port

four, left panel 1, the left shows all the currently available emulators or devices list and the list of virtual machines that each device is currently running. The virtual machine is displayed according to the program's package life.

2, these lists allow you to find the virtual machine running the activity you are trying to debug. Next to each virtual machine is the "debugger pass-through" port, which links to one of the ports that is linked to the corresponding virtual machine on the device. However, when using DDMS, you only need to link to port 8700 because DDSM forwards all the traffic to the currently selected virtual machine. This way, it is not necessary to reconfigure the debugger port each time the virtual machine is switched.

3, when a running program calls the Waitfordebugger () function, the client name will be displayed next to a red icon, know debugger connected to the corresponding virtual machine, which is debugger will turn green.

4. If you see the fork icon, it means that the DDMS is used to not open the port of the virtual machine and cannot establish debugger to establish a connection with the virtual machine. If you see all of the virtual machines, it is likely that there is another DDSM instance running.
Five, right panel 1,info
The general information about the selected VM is shown here, including the process ID, package name, and virtual machine version.

2,threads
The Threads view lists all the threads for this process.

ID: The unique thread ID assigned by the virtual machine, in Dalvik, which is an odd number starting from 3.
tid:linux thread id,for The main thread in a process, this would match the process ID.
stauts: Thread state,
Running: Executing program code
sleeping: Executed the Thread.Sleep ()
Monitor: Wait for a listening lock to be accepted.
wait:Object.wait ()
Native: Executing native code
vmwait: Waiting for a virtual machine
Zombie: Thread in the dying process
init: Thread is initializing (we can't see it)
starting: Thread is starting (we can't see it)
Utime: Cumulative time to execute user code
stime: Cumulative time to execute system code
Name : The names of the threads

4,VM Heap
shows the status of some heaps, updated during garbage collection. When a virtual machine is selected, the VM heap view cannot display data, click the Green Show heap updates button on the right side of the bread, and then click Cause GC to implement garbage collection update heap status.


6,allocation Tracker
in this view, we can track the memory allocation of each selected virtual machine. Click "Start Tracking" and click "Get Allocations" to see.


7,emulator Control
here, you can simulate some device states and behaviors.

Telephony Status: Change the state of phone voice and data scenarios to simulate different network speeds.
TelePhony Actions: Send analog phone calls and SMS to the simulator.
location Controls: Send virtual location data to the simulator and we can perform operations such as positioning. It can be done in manual. Enter latitude and longitude to the simulator, or you can pass GPX and KML files.

Six, other 1,file Explorer
The File Explorer is opened through device > File Explorer. Here you can browse files, upload and delete files, of course, there is a corresponding permission restrictions.

2,screen Capture
with device > Screen Capture, you can.


3,exploring Processes
through device > Show process status, the information here is output through the shell command "Ps-x".

4,examine Radio State
detects broadcast status via device > Dump radio.

5,stop a Virtual machine
stop a virtual machine by using the Actions > Halt VM.

Good text Collection ....

Android Debugging Tools Ddms use of the detailed

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.