Joke Collection Website - Public benefit messages - How to use DDMS tool in Android Studio

How to use DDMS tool in Android Studio

With the widespread use of android studio, developers' demand for related tools is more prominent. Yesterday, I saw an article about the use of DDMS tools on an android studio tutorial website, and I felt very good. Share it with everyone. Let's have a look. Get new skills ~ ~

First of all, what we need to know is what exactly is DDMS tool?

Actually, DDMS(Dalvik debugging and monitoring service) is Android.

Debugging and monitoring service of Dalvik virtual machine in development environment. Operations that can be performed include: taking screenshots of test equipment, viewing running thread and heap information in a specific trip, Logcat and broadcasting status letters.

Information, analog phone, receiving short messages, virtual geographic coordinates, etc. Very powerful, it is a very good tool for Android developers. Let's take a look at their specific usage.

In the Android Studio development tool, open DDMS.

1. device: View the details of all simulators connected to DDMS, as well as the APP process running by each simulator. The rightmost part of each process corresponds to the port linked to the debugger.

2. Simulator control: control the simulator, such as answering the phone, simulating various network conditions according to the options, simulating the sending of short messages, and testing the GPS function with virtual address coordinates.

3.LogCat: View log input information, which can be filtered by filter or filtered to view some debugging information.

4. File Exporter: File Exporter File Browser, which can easily import/export files by viewing files in the Android emulator.

5. Heap: Check the memory usage in the application.

6. dump hprofile: click dump on the DDMS toolbar.

HPROF file button, select the file storage location, and then run hprof-conv. MAT can be used to analyze heap dumps.

Move MAT and load the HPROF file we just generated. MAT is a powerful tool, and it is beyond the scope of this article to describe all its features, so I just want to demonstrate a tool that can be used for testing.

Leakage method: histogram view. It displays a list of class instances that can be sorted, including: shallow

Heap (the sum of memory usage of all instances), or reserved heap (the sum of allocated memory of all class instances, including all their reference objects), and so on.

7. Screen capture: Screen capture operation

8. Threads: View the threads in the process.

9. Other tools.

It can be said that it is not intuitive to simply show the use of several:

View threads in the process

View memory information

File management, you can import and export files, and many operations of the real machine may require Root permission. The simulator can simulate sending text messages, making phone calls, positioning and so on. ;

View the presentation and layout elements of a specific page:

The above only shows four functions through pictures. Due to the limited space, I will introduce it here. More functions can be explored slowly in practice. If you have any new discoveries or skills, please share them.