Share the hottest ios information
abstract
This article lists the commonly used Android developer options. Understanding and skilled use of these developer options can help us locate problems encountered in development, help us understand the performance problems of applications, and greatly help improve development and optimization efficiency.
1. Stay away
Usage scenario: When debugging with USB, after debugging for a period of time, if you want to do the next operation on the phone, you suddenly find that the phone is blank and you need to unlock it.
Instructions: The screen is always on when debugging, and my mother no longer has to worry about debugging. The screen is black!
2. Process Stats
Usage scenario: check the background process and resource occupation, and graphically display the processes running in the background, as well as the corresponding running time and memory occupation.
Usage 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 that it is in the normal range, yellow indicates that it is a little nervous, and red indicates that it is in an emergency state. The following list area shows the currently running process. The percentage on the upper right indicates the relative time of running during this period, and 100% indicates that it is running during this period. Click Enter to see the memory usage details.
In the figure, the memory (RAM) usage and the list of running services are shown respectively.
These information can also be checked through adb, and the corresponding commands are as follows:
Adb shell dumpsys activity (Activity Manager system service related information, including Activity, Broadcast, Service and ContentProvider)
Adb shell dumpsys meminfo (memory usage information)
Adb shell dumpsys procstats – hours 3 (check the process usage in the past three hours)
Reference for more information link 。
3. Wait for debugger&Select debug app
Usage scenario: In some cases where you need to start the APP and need to debug it, or when you need to debug the APP and start the crash. At this time, the app process usually crashes before it is time to mount the breakpoint.
Instructions: Select the development app in the Select debug app, check Wait for debugger, and then start the app.
4. Show touch&Pointer location
Usage scenario: when inspecting the view click area or inspecting the touch gesture, it is necessary to inspect the click position and operation accordingly.
Instructions: show touches displays the touch position, and Pointer location displays the touch gesture.
5. Animation scale
Use scene: debug complex animation, which can slow down the animation effect, so as to carefully inspect and debug the animation.
Use instructions: After you turn it on, select the corresponding zoom ratio, and you can feel it clearly.
6. Show layout boundaries
Usage scenario: check the view area, and the corresponding margin and padding
Instructions: You can see the effect after opening it
7. Debug GPU OverDraw
Let's first look at what over painting is. When we draw an interface, we often have multiple levels. For example, we draw a picture on a white background, but the white background under the picture is invisible to us, and this part does not need to be drawn. We call this phenomenon over drawing. Obviously, over drawing has caused extra work, which is a problem that we should try our best to stop.
Usage scenario: check whether the developed APP has a serious problem of over drawing.
Instructions: You can see the effect after opening it. Select Debug GPU OverDraw and check Show overview areas. Overdrawing credentials are divided into blue (1x), yellow (2x), red (3x), and dark red (4x+) layers. We should try our best to keep our interface level in blue or yellow.
8. Profile GPU rendering
Usage scenario: as we know, if a period of painting time exceeds 16 ms, users can actually feel the visual difference, which is often referred to as "Carton". The GPU appearance mode allows us to check the time spent in drawing each frame in a graphical way to see whether it is 16 ms higher than the time spent in drawing each frame. In this mode, we can roughly locate the operation block in comparison with the stuck block. We analyze the picture. There are many vertical lines in the picture. These vertical lines represent a frame. Each color of the vertical line represents a certain step in the drawing process. The height is the time spent. The horizontal line above indicates 16ms. Any vertical line can be compared with 16ms. If it exceeds 16ms, its drawing time will exceed the recommended time range, which will cause the interface to get stuck. Developers can preliminarily locate the stuck problem by checking what operations will make the vertical line soar.
Instructions: Click Profile GPU rendering and select On screen as bars
9. Don't keep activities
Usage scenarios: In the actual production environment, some more severe problems will often be triggered than in the Debug environment. This is usually used to simulate the situation where memory is limited and invisible activities are recycled. In this mode, it is easy to trigger some unusual crashes, so that developers can improve the stability of applications.
Instructions: Open Don't keep activities.
Use will to overcome body inertia!