DSlomer64 DSlomer64 - 1 year ago 132
Android Question

Break on variable value change in Android Studio 1.1.0?

I know I could set a breakpoint at every line where my code changes the variable, but is there an option such as right-clicking a variable (to "Add to Watches") that would stop when a variable changes value?

I think C++ has this option. See this.

And Eclipse? See this.

Is this implemented in AS?

Answer Source

You can break on value changes of some variables in Android Studio 1.1.0.

Android Studio calls them 'Java Field Watchpoints'.

From the breakpoints windows, (Run -> "View breakpoints...") or Ctrl+Shift+F8, you can add "Java Field Watchpoints" from the plus in the top left corner, and then select your class and variable.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download