繁体   English   中英

如何将 Flutter 与 Genymotion 连接起来?

[英]How do I connect Flutter with Genymotion?

我在使用 Genymotion 在 Android 模拟器上运行我的 Flutter 应用程序时遇到问题。

启动模拟器后,我尝试“颤动运行”,但没有成功。 控制台显示“没有连接的设备”。

那么如何将 Flutter 与 Genymotion 联系起来呢? 你能告诉我一些事情吗? https://gyazo.com/7d75068683c043922c5fff75377e9817 https://gyazo.com/c9ccae04ffdfba3fa66fa6ff7e038e8f

我之所以要使用 Genymotion 是因为 Android Studio 太重了。

但我想知道 Flutter 在没有 Android Studio 的情况下无法在 Genymotion 上运行。

  1. 安装适用于 Android Studio 的 Genymotion 插件(在 AS 中:Tools > SDK Manager > Plugins > Genymotion)。 重启 AS

  2. 在 Genymotion 中配置 SDK(Genymotion > Preferences > ADB > Use custom Android SDK tools)然后使用路径 /Users/{Your user}/Library/Android/sdk (安装 AS 后的默认位置)

  3. 在 Genymotion 中创建一个新设备

  4. 在 AS 中配置正确的 Genymotion 路径:

    一个。 查看 > 工具栏(如果不是默认出现,则显示 Genymotion 图标)

    湾。 按工具栏中的 Genymotion 图标(出现在右侧的放大镜旁边)

    C。 将路径指向 Genymotion 文件夹位置(例如:/Applications/Genymotion)

    d。 关闭盒子

现在你已经设置好了,所以以后按下图标,选择你的模拟器并运行在 Android Studio 中启动。 在尝试使用 flutter run 命令运行应用程序时,flutter 会检测到这一点。

首先启动您已经下载并安装的 Genymotion 模拟器。

当模拟器状态为ON时,打开命令并运行以下命令:

flutter devices

如果您在输出中看到已安装的图像,则如下所示,那么一切都很好:

PS F:\osx> 颤振设备

1 个连接的设备:

三星 Galaxy S9 • 192.168.150.101:5555 • android-x86 • Android 8.0.0 (API 26)

只需在VScodeAndroid Studio上选择设备并点击运行。

1) Install genymotion correctly. you can see here: [https://www.genymotion.com/plugins/][1]
  1. 为 Android Studio 安装 Genymotion 插件
2-1) In Android Studio, go to File/Settings (for Windows and Linux) or to Android Studio/Preferences (for Mac OS X)
2-2) Select Plugins and click Browse Repositories.

2-3) Right-click on Genymotion and click Download and install.

如果 genymotion 图标不出现,这就是您需要做的。

2-4) To see Genymotion plugin icon, display the toolbar by clicking View > Toolbar.

在最后一步之后,我现在可以看到图标并使用 genymotion 运行我的应用程序。

我希望这对您的问题有所帮助,因为在努力找到它对我有用之后

执行:

颤振运行--启用软件渲染

从 IDE 中的运行/编辑配置菜单

来源: https ://github.com/flutter/flutter/issues/11094#issuecomment-372662053

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM