Reputation: 4138
In Xcode I am able to "po" any values while debugging. Is there a way to do this in Android Studio?
For example, if I hit a breakpoint and want to print out certain values in realtime as opposed to having to use Logs in my code?
Upvotes: 30
Views: 14017
Reputation: 1
If it's a c/c++ project, you still can use lldb command in Android Studio. Here's the official document. When you hit the breakpoint, you will see a tab named "lldb" next to the variables tab.
Upvotes: 0
Reputation: 16587
You can do the following steps:
1- Set BreakPoint in the line you want to evaluate Ctrl+F8
.
2- Run your code in debug mode or press Shift+F9
.
3- When reached to the BreakPoint press Alt+F8
or click on the following button.
4- Then type your value in text-field and click on the Evaluate button.
References:
Upvotes: 17
Reputation: 8478
When you hit debug point, there are two ways to check values :
(1) Add Watch for any variable
(2) Hover over any variable, the value will be displayed there
Upvotes: 5