Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Examining variables while debugging in Android Studio

I'm looking for a way to examine the value of variables while debugging in Android Studio. In Xcode, you can type commands into the terminal window to execute code. For example: po user.name would print the user's name. There is a similar facility in the Chrome debugger. You could just type user.getFriends() and it would output the list of friends.

Does something like this exist in Android Studio? At the moment I'm limited to having to examine the variables in the Variables window which is slower and much less flexible because you can't print the value of functions.

like image 618
James Andrews Avatar asked Oct 12 '25 09:10

James Andrews


1 Answers

When debugging an application, you can set a breakpoint and when that triggers, you can right click in the editor and select 'Evaluate Expression...' I believe this will give you close to what you are looking for.

like image 145
jdonmoyer Avatar answered Oct 15 '25 18:10

jdonmoyer