【问题标题】:Flutter - Command line - Emulator- Device not found颤振 - 命令行 - 模拟器 - 找不到设备
【发布时间】:2019-03-05 13:08:23
【问题描述】:

免责声明 - 新手

只需 DL 在我的 Windows 10 电脑上开始使用 Flutter 所需的一切。

Flutter sdk - 保存到我桌面上的文件夹中 Git Google USB 驱动程序
Visual Studio Code 及其 Flutter/Dart 插件 Android Studio 及其 Flutter/Dart 插件

现在我可以启动 Android Studio 并选择一个模拟器(默认情况下显示“未连接设备”),点击运行,模拟器可以工作,但是如果我进入命令行,这就是我得到的结果,我跟进了'颤振模拟器''颤振医生'

当我告诉它检查模拟器时,它告诉我“要运行模拟器,请运行 'flutter emulators --launch '” 我在哪里可以找到身份证?

C:\Users\admin\Desktop\Computer Science\Flutter Projects\first_app>flutter 
run
No connected devices.

C:\Users\admin\Desktop\Computer Science\Flutter Projects\first_app>flutter 
emulators
2 available emulators:

Nexus_5X_API_28_x86 • Nexus 5X • Google • Nexus 5X API 28 x86
Nexus_6P            • Nexus 6P • Google • Nexus 6P

To run an emulator, run 'flutter emulators --launch <emulator id>'.
To create a new emulator, run 'flutter emulators --create [--name xyz]'.

You can find more information on managing emulators at the links below:
https://developer.android.com/studio/run/managing-avds
https://developer.android.com/studio/command-line/avdmanager

C:\Users\admin\Desktop\Computer Science\Flutter Projects\first_app>flutter 
doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.8.2, on Microsoft Windows [Version 
10.0.17134.285], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[√] Android Studio (version 3.2)
[√] VS Code (version 1.27.2)
[!] Connected devices
    ! No devices available

! Doctor found issues in 1 category.

【问题讨论】:

    标签: dart flutter


    【解决方案1】:

    试试这个来启动你的模拟器,然后你将连接设备。 运行模拟器后,尝试运行颤振应用程序。 现在你没有运行任何模拟器,为什么它告诉你没有连接的设备......

    flutter emulators --launch Nexus_6P
    

    【讨论】:

    • 如果设备没有在launch.json文件中运行,你知道如何自动实现吗?
    【解决方案2】:

    如果你想通过 Flutter 在你的连接设备中运行应用程序,那么首先通过输入获取设备名称或 id flutter devices 它会给你信息

    并通过运行此命令来运行应用程序

    【讨论】:

      【解决方案3】:

      第一步:在cmd中进入你创建flutter项目的项目文件夹(使用cd Root/of/your/project

      第 2 步:运行以下命令:

      flutter emulators --create <whateverIdYouLike>
      (Eg:- For my project I used `flutter emulators --create Nexus_6`)
      

      这应该给你的信息:

      “模拟器 [名称] 创建成功。”

      第 3 步:输入以下命令:

      flutter emulators
      

      你会看到一个模拟器已经添加成功了。

      第 4 步:使用以下命令启动模拟器:

      flutter emulators --launch <emulator id> //in my case, the id of the newly created emulator was "flutter_emulator"
      

      更多信息请查看 https://developer.android.com/studio/run/managing-avds https://developer.android.com/studio/command-line/avdmanager

      【讨论】:

      • 我使用命令flutter emulators --create Nexus_6 创建了模拟器,然后在命令flutter emulators 中我可以看到2 个模拟器Nexus_6flutter_emulator 但是当我运行flutter doctor 时我仍然只得到3滴答声和connected device no device available
      【解决方案4】:

      尝试在您的系统上安装Vysor,然后通过USB线将其与手机连接,现在手机屏幕将镜像到系统上,并将充当模拟器。

      【讨论】:

        猜你喜欢
        • 2019-04-24
        • 2020-03-11
        • 1970-01-01
        • 2019-01-12
        • 2018-11-12
        • 2021-09-07
        • 2021-01-07
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多