Error: ADB exited with exit code 1 Performing Streamed Install adb: failed to install D:\svn\app\sm

使用vscode允许flutter项目出现问题:Error: ADB exited with exit code 1 Performing Streamed Install adb: failed to install

提示:搭建好vscode的Flutter环境后,我运行了一个flutter项目,flutter run 后报错:


报错:Error: ADB exited with exit code 1 Performing Streamed Install adb: failed to install D:\svn\app\smis\build\app\outputs\flutter-apk\app.apk: Failure [INSTALL_FAILED_USER_RESTRICTED: Install

在这里插入图片描述

解决方案:

1.我的项目是使用真机进行联调的,需要打开手机的开发者模式,允许usb调试,允许usb安装;
2.然后在vscode中flutter run运行的时候,选中我的真机。

在这里插入图片描述
点击修改,vscode的这个位置,为你想要调试的真机。(点击后 会出现下图,有已经可以调试的,或可以create新增模拟器。)
在这里插入图片描述

然后运行 flutter run (如果此时你有多个可以环境可供选择,还需要选择一个,我选择了真机环境)
在这里插入图片描述
当然也可以选择模拟器,只要两次设置一致即可。

猜你喜欢

转载自blog.csdn.net/qq_41117240/article/details/123893201