Processing Method-
1. Computer ADB connected devices
2.CMD command: adb shell enters shell mode
Top-h-M 10 prints out the top 10 threads of CPU utilization
3. In the printed thread, find the thread that is relevant to your app, and look at the suspect thread,
Then go into the androidstudio of the Devcemonitor, the specific look at the picture:
4. You will see:
After opening this interface, you should select the process you want to monitor and click on this so that the threads bar on the right will see all the threads of the process.
Remember the suspicious thread ID you found before? Find the corresponding row of data here, select the row, you can see this below:
This is the thread-related code stack.
So you can get into the code to track down the problem.
Does the code have a dead loop? Or did you use a resource that wasn't released? Repeat create? Concrete analysis of specific problems.
Android app CPU consumes too much CPU case