xccjk / x-blog

学习笔记
17 stars 2 forks source link

flutter run报错No supported devices connected #46

Closed xccjk closed 2 years ago

xccjk commented 3 years ago

运行flutter run出现错误:No supported devices connected

在通过flutter run启动项目的过程中,遇到提示No supported devices connected的错误,错误的意思为没有找到连接的设备

解决方案

  1. 运行flutter doctor,查看设备情况
flutter doctor
  1. 运行flutter emulators,查看可连接设备
flutter emulators
  1. 运行flutter emulators --launch <emulator id>,连接到指定设备,此时会打开一个模拟器
// mac端
flutter emulators --launch iOS Simulator
// windows
flutter emulators --launch Pixel_3a_API_30_x86
  1. 运行flutter run,启动项目,正常运行
flutter run