![](/img/trans.png)
[英]How can I connect Flutter in VS Code with the BlueStacks 4 emulator?
[英]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 上運行。
安裝適用於 Android Studio 的 Genymotion 插件(在 AS 中:Tools > SDK Manager > Plugins > Genymotion)。 重啟 AS
在 Genymotion 中配置 SDK(Genymotion > Preferences > ADB > Use custom Android SDK tools)然后使用路徑 /Users/{Your user}/Library/Android/sdk (安裝 AS 后的默認位置)
在 Genymotion 中創建一個新設備
在 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)
只需在VScode或Android Studio上選擇設備並點擊運行。
1) Install genymotion correctly. you can see here: [https://www.genymotion.com/plugins/][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.