Android Studio - Where can I see callstack while debugging an android app?
Asked Answered
S

3

111

While on a break point, how do I see the call stack to find the callee method/function?

Sham answered 12/1, 2014 at 6:29 Comment(0)
R
120

At the bottom panel you should have "5: Debug". Click on it and select "Debugger -> Threads"

You may need to find the "Threads" icon on the far right, or even click the "Restore Layout" button on the left to restore this window.

enter image description here

Rinaldo answered 12/1, 2015 at 13:37 Comment(6)
I see only: { Debugger, Console, Logcat }. Where is "Threads" ?Diffluent
Thanks Nickolai, I didn't find "Threads" because I had closed it. I clicked on the icon on the right of the Tabs and I reopened it.Diffluent
This took me ages to find and is very counter intuitive. :( . You can turn off the terrible counter intuitive hiding on the settings cog in the extreme top right of the debug window and ensure "Show Views as Tabs" is uncheckedExternality
It may be minimized to the right, find the button with the little arrow pointing at a line (top right corner of the bottom panel) and click it. It will expand againRuinous
i can see the call stack, but how do I see the PC of each frame?Rienzi
very nice ! Thank youPuryear
W
155

Seems like there is an UI-Bug in the Android Studio (1.x, 2.x and 3.x).

For me the "Frames/Threads" Panel was completely hidden behind the toolbar, so I had to change the size from the "variable" panel by dragging its left border to reveal the "Frames/Threads".

Example

[I have to admit, that @Greg added this picture after reviewing my answer!]

Williamswilliamsburg answered 3/8, 2015 at 15:48 Comment(4)
This was the second time I've come across your answer to fix this. Shame i can't upvote for both times!Caspar
@Caspar shame that it's still not fixed ;)Williamswilliamsburg
That panel was totally hidden 100%! Thank you for the clear picture!Matthia
Yes, the same dragging out works for me. How could this happen? Studio can make it better, right?Heel
R
120

At the bottom panel you should have "5: Debug". Click on it and select "Debugger -> Threads"

You may need to find the "Threads" icon on the far right, or even click the "Restore Layout" button on the left to restore this window.

enter image description here

Rinaldo answered 12/1, 2015 at 13:37 Comment(6)
I see only: { Debugger, Console, Logcat }. Where is "Threads" ?Diffluent
Thanks Nickolai, I didn't find "Threads" because I had closed it. I clicked on the icon on the right of the Tabs and I reopened it.Diffluent
This took me ages to find and is very counter intuitive. :( . You can turn off the terrible counter intuitive hiding on the settings cog in the extreme top right of the debug window and ensure "Show Views as Tabs" is uncheckedExternality
It may be minimized to the right, find the button with the little arrow pointing at a line (top right corner of the bottom panel) and click it. It will expand againRuinous
i can see the call stack, but how do I see the PC of each frame?Rienzi
very nice ! Thank youPuryear
V
0

It depends on the version of Android Studio. In Android Studio 4.x (screenshot from 4.1.3), it is the camera icon on the left, as seen in the screenshot. Hover over it and you see "Get thread dump", even though it may be counter-intuitive, being more often associated with taking a screenshot.

Android Studio 4.1.3 example

I just checked Android Studio Dolphin, it is the same button.

Vulturine answered 12/8, 2023 at 11:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.