命令行启动 devtools
: flutter pub global run devtools
报错信息如下:
No active package devtools.
pub finished with exit code 65
出现这样的错误是没有安装并激活调试工具,通过以下命令就可以激活 devtools
:
flutter pub global activate devtools
MacOS 安装的时候会出现以下警告,让配置环境变量,如果需要就配置,不需要则不用管他:
Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path.
You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.):
export PATH="$PATH":"$HOME/.pub-cache/bin"