Android Studio (二) —— Android Studio高级代码调试功能

2,874 阅读2分钟

调试工具窗口

Rerun 'main.dart'

重新运行'main.dart'

Show Execution point(Option/alt + F10)

显示执行点

Step Over(F8)

要前进到下一行代码(而不进入方法)

Step to the line in this file

步入此文件中的行

Step Into(F7)

要前进到方法调用内的第一行

Step to the next line executed

转到执行的下一行

Fore Step Into(Option/Alt + F7)

进入

Step Into, Ignore stepping filters for libraries, constructors, etc.

进入,忽略库、构造函数等的步进过滤器。

Step Out(Shift + F8)

要前进到当前方法之外的下一行

Step to the first line executed after returning from this method 从该方法返回后执行的第一行

Run to cursor(Option + F9)

运行到光标

Run to the line where the caret is

运行到插入符号所在的行

evaluate expression (Option + F8)

计算表达式

evaluate arbitrary expression 计算任意表达式

Evaluate Expression通过它可以查看当前类中所有的变量的值,并且可以计算表达式的值,甚至可以运行某个函数,得到结果。可以尝试下,在输入的时候有代码提示,比如在输入框输入我们上面的求和的函数,就能直接得到运行结果。

Trace Current Stream Chain

跟踪当前流链

Drop Frame(Flutter)

降帧

Pop the current frame off the stack 将当前帧从堆栈中取出

Flutter hot reload(command + \)

Flutter 热重载

Hot reload changes into the running Flutter app 热重新加载更改为正在运行的Flutter应用程序

Flutter Hot Restart(Shift + Command + \)

Flutter 热重载

重新启动Flutter应用程序

Restart the Flutter app

Open DevTools

打开开发工具

Open Dart DevTools

打开Dart开发工具

Open Observatory 开放平台

Open Timeline View 打开时间轴视图

竖向控制按钮

标号 名字 作用
Rerun android debugger 启动或者重启debugger
resume program (option + Command + R ) 运行程序,到下一个断点处
pause program 暂停程序
stop android debugger 停止debugger,终止调试
View Breakpoints (Shift + Command + F8 打开断点设置面板,和从菜单栏Run-->view breakpoints 进入的是同一个
Mute Breakpoints 暂时停用所有的断点
7 Get Thread dump 获取某个进程的信息
Restore Layout 恢复原来的debugger控制面板的布局
Settings 设置在调试过程中,会显示哪些信息(可以点开看看)
10,11,12 固定窗口,关闭窗口,查看帮助

设置在调试过程中,会显示哪些信息

  • Show values Inline
  • Sort Values Alphabetically
  • Unmute Breakpoints on Session Finish
  • Enable value renderers
  • Hide out-of-scope variables
  • Flutter Hot Reload (All Devices)(Option + Command + \)
  • Flutter Hot Restart (ALl Devices)(Option + Shift + Command + \)

竖向中间控制按钮

Previous Frame (Option + Command + 向上箭头)

导航到上一个匹配项 Navigate to the previous occurrence

  • New Watch
  • Remove Watch
  • Move Wathch Up(Control + 向上箭头)
  • Move Watch Down(Control + 向下箭头)
  • Duplicate Watch(Command + D)
  • Show watches in variables tab

Other

  • Show ToolBar
  • Pinned Mode
  • Docked Mode
  • Floating Mode
  • Windowed Mode
  • Split Mode
  • Remove from Sidebar
  • Move to
  • Resize

  • Project
  • Packages
  • Project Files
  • Production
  • Project Source Files
  • Project Non-Source Files
  • Problems
  • Changed Files
  • Default Changelist