How to make Java Thread Dump in Android?

后端 未结 6 1807
面向向阳花
面向向阳花 2020-12-29 11:00

I just want to get all dumps from java virtual machine threads, to look at what the threads lock and what threads waiting to unlock some resources. Something like is describ

6条回答
  •  不思量自难忘°
    2020-12-29 11:14

    If you don't have a rooted device and your app isn't a debug build, you can still generate a bug report from developer options to get the thread dump. The dumps are under the VM TRACES JUST NOW section of the bugreport*.txt file.

    It's quicker if you know the ID of the thread you're suspecting. You can get the PID of the app by calling:

    adb shell ps -A | grep com.example.myapp
    

    and the thread ID with:

    adb shell ps -T | grep 
    

提交回复
热议问题