Reputation: 131
I am new to Android development with Eclipse. I am asking a very basic question : is it possible to watch / spy the content of a variable during the debugging session? (a bit like in Visual Studio)
I know It is a fairly lame question, but I couldn't figure it out myself.
thanks in advance,
Gallien
Upvotes: 2
Views: 9867
Reputation: 3652
The most easiest way, is to hover over the variable name while debugging and it shows you the whole object. I work on eclipse kepler latest version.
Upvotes: 0
Reputation: 11899
First select Debug perspective as:
Then set Breakpoints at places you want:
After that create a Debug configuration via Debug As->Debug Configurations... and then Debug as Android Application as shown below:
Then in Debug perspective you can trace/watch value of your desired variable by pressing F8:
That's it, you can also evaluate expressions through Expressions view. If it is not enabled select it from:
Window->Show View->Other->Debug->Expressions.
Upvotes: 10
Reputation: 61
When you have open debug perspective, click window->show view->expressions. After that, you can input a variable name manually. You can select a variable in code then right click, there will be a link named 'watch'. You'll get it!
Upvotes: 0
Reputation: 2376
Yes, you may view variables whilst debugging.
To set a watch point, select a variable in the 'Outline' view in the 'Debug' perspective. Right click the variable, and press 'Toggle Watchpoint'.
More information available here
Upvotes: 0
Reputation: 2173
you can use the Expressions tab in the debug perspective. Also you can observe the variable when you hit a breakpoint - check this link: http://www.ibm.com/developerworks/library/os-ecbug/
Upvotes: 0