我试图用Flutter创建一个示例应用程序(新安装)。还安装了Android Studio(新安装)。

这是颤振运行的输出

flutter run
No connected devices.

颤振医生输出:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.1.5, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] Android Studio (version 3.0)
[!] VS Code (version 1.20.1)
[!] Connected devices
! No devices available

! Doctor found issues in 2 categories.

这个问题有解决办法吗?


当前回答

步骤1:执行命令:flutter devices检查已连接设备

步骤2:如果在可用模拟器列表中没有任何连接的设备,请运行:flutter emulators

步骤3:要运行模拟器,请运行:flutter emulators——launch <模拟器id>

步骤4:如果没有可用的模拟器,运行:flutter emulators——create[——name xyz]

==>

步骤1:要查看模拟器列表,运行:emulator -list-avds

步骤2:现在要启动模拟器,运行:emulator -avd avd_name

==>

步骤1:打开-a模拟器

步骤2:扑动运行(在您的应用程序目录中)

其他回答

在Visual Studio Code中打开终端,并编写以下命令:

flutter devices

flutter daemon -v

之后,使用cmd连接:

cd (ADB folder)

adb tcpip 4455
adb connect 192.168.1.11:4455 (use your device IP address)

这就是我的解。

首先将设备连接到笔记本电脑,在移动设备上,打开智能手机的设置,搜索“开发人员选项”,然后单击它,在设备上启用USB调试。

然后打开项目,打开终端,输入“颤振运行”

这样你的设备就被识别出来了。

然后设置你的Android模拟器。

在Android Studio中,顶部没有设备选项。点击它,继续选择你的设备,等待几分钟,你可以在智能手机或模拟器上看到你的应用程序,根据你选择的Android模拟器。

只是我的案子。在这些答案中我还没有找到这个解。

系统

Android 10设备。

Mac与macOS v10.14.6 (Mojave, 18G4032)。

我的Android设备上启用了开发人员选项和USB调试。

Flutter SDK已安装在我的Mac上。

问题

当Android设备用USB线连接到我的Mac时,flutter devices命令仍然显示:没有可用的设备。

解决方案

幸运的是,我的Android设备弹出了一个弹出窗口,建议我在Mac上安装Android File Transfer。

在我的Mac上安装了Android File Transfer后,flutter devices命令显示我的Android设备已连接。

应该至少连接一个设备/模拟器来运行Flutter应用程序。

还要确保在开发人员设置中启用了USB调试。

步骤1:执行命令:flutter devices检查已连接设备

步骤2:如果在可用模拟器列表中没有任何连接的设备,请运行:flutter emulators

步骤3:要运行模拟器,请运行:flutter emulators——launch <模拟器id>

步骤4:如果没有可用的模拟器,运行:flutter emulators——create[——name xyz]

==>

步骤1:要查看模拟器列表,运行:emulator -list-avds

步骤2:现在要启动模拟器,运行:emulator -avd avd_name

==>

步骤1:打开-a模拟器

步骤2:扑动运行(在您的应用程序目录中)