Abstract This article lists the common Android developer options, understanding and skilled use of these developer options, can help us locate the problems encountered in development, assist us to understand the application performance problems, to improve the development and optimization efficiency of a great help.

1. Stay awake

Usage scenario: During USB debugging, you often find that the screen of the mobile phone is black and need to unlock it when you want to perform the next operation after debugging for a period of time.

Use instructions: debugging screen has been steady on, mother no longer need to worry about debugging, black screen!

2. Process Stats

Usage scenario: View background processes and resource usage. The background processes, running time and memory usage are graphically displayed.

Instructions: as shown in the figure, the upper left corner refers to the time range of its statistics, while the progress color of the bar area below it shows the current memory usage, green indicates normal range, yellow indicates some tension, and red indicates emergency state. The list area below shows the currently running process, with the percentage at the top right indicating the relative time it was running during that time. 100% means it was running during that time. Click in to see the memory usage details.

In the figure, the memory (RAM) footprint is shown, along with a list of running Services.

The information can also be viewed with adb, using the following command:

Adb shell Dumpsys Activity (Information about ActivityManager system services, including activities, Broadcast, Service, and ContentProvider)

Adb shell Dumpsys meminfo

Adb shell Dumpsys procstats — hours 3 adb shell Dumpsys procstats — hours 3

See links for more information

3. Wait for debugger & Select Debug app

Usage scenario: Some need to enable APP Debug urgently, or need to Debug APP startup crash. At this point, the App process usually crashes without the need to mount the breakpoint.

Instructions: Select the app development option in the Select Debug app and check Wait for debugger before starting the app.

4. Show touches & Pointer location

Usage scenario: When viewing the view click area or viewing touch gestures, you need to view the click position and operation accordingly.

[niv] show touches; Pointer location displays touch gestures.

5. Animation Scale

Use scene: Debug complex animation, you can slow down the animation effect, so that you can observe and debug the animation carefully.

Instructions: After opening, select the corresponding zoom ratio, you can obviously perceive.

6. Show the layout bounds.

Use the scene: View the area of the view, and the corresponding margin and padding.

Instructions: You can see the effect after opening.

7. Debug GPU OverDraw

Let’s look at what overdrawing is. When we draw an interface, there are often multiple layers. For example, a picture is drawn on a white background, but the white background covered below the picture is invisible to us, and this part also does not need to be drawn. We call this phenomenon overdrawing. Obviously, overdrawing creates extra work and is something we should avoid as much as possible.

Usage scenario: Check whether the APP has a serious over-drawing problem.

To see the effect, select Debug GPU OverDraw and check Show OverDraw Areas. Depending on the number of extra layers drawn, we can divide them into blue (1x), yellow (2x), red (3X), and dark red (4x+). We should keep our interface layers blue or yellow as much as possible.

8. GPU Rendering (GPU rendering Model analysis)

Usage scenario: As we know, if the drawing time is longer than 16 ms, the user can actually feel the visual difference, which is often referred to as the lag. The GPU rendering mode allows us to graphically check the time taken to draw each frame and whether it is more than 16 ms. In this mode, it is possible to roughly locate the operation in which block is more sluggish. The vertical lines represent a frame. Each color of the vertical line represents a particular step in the drawing process. The height is the time it took. The horizontal line above represents 16ms, and any vertical line can be compared to 16ms. If it exceeds 16ms, it will take longer to draw than the recommended time range, causing the interface to lag. Developers can initially locate the problem by looking at what actions can cause the height of the vertical line to spike.

Instructions: Click On Profile GPU Rendering and select On Screen as Bars.

9. Don’t keep activities

Usage scenario: In a real production environment, more stringent issues are triggered than in a Debug environment, which is usually used to simulate a situation where memory is limited and Activity is not visible to be reclaimed. In this mode, it is easy to trigger some rare crashes, making it easier for developers to improve the stability of their applications.

Instructions: Turn on Don’t keep Activities.