问题描述
我知道我可以在我的代码更改变量的每一行设置一个断点,但是是否有一个选项,例如右键单击一个变量(以添加到手表"),该选项会在变量更改值时停止?
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?
我认为 C++ 有这个选项.看这个.
I think C++ has this option. See this.
还有日食?看到这个.
这是在 AS 中实现的吗?
Is this implemented in AS?
推荐答案
Android Studio 1.1.0 中部分变量的值改变可以中断.
You can break on value changes of some variables in Android Studio 1.1.0.
Android Studio 称它们为Java 现场观察点".
Android Studio calls them 'Java Field Watchpoints'.
从断点窗口,(Run -> "View breakpoints...") 或 Ctrl+Shift+F8
,您可以从左上角的加号添加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.
这篇关于中断 Android Studio 1.1.0 中的变量值更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!