James Andrews
James Andrews

Reputation: 3304

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.

Upvotes: 4

Views: 2649

Answers (1)

jdonmoyer
jdonmoyer

Reputation: 1270

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.

Upvotes: 6

Related Questions