Flutter failing to connect to emulator with VSCode

让人想犯罪 __ 提交于 2019-12-06 03:54:28

Steps:

  1. Open Android Studio
  2. Tools -> AVD Manager
  3. Virtual Device -> Actions (Refer Image)
  4. Click On Stop
  5. Now Start Emulator

Now it's working fine :)

For android emulator there are alternatives like geanny motion.

Since you have AVD installed you could try running from the command line. run flutter devices to get the list of emulators and their id. then run (assuming emulator-5554 is you emulator id) flutter run -v -d emulator-5554

Finally you the option of starting android studio then start your emulator,form the IDE and the run the above command or you even run the app from the IDE.

I am using Genymotion 3.0.2., VS Code (version 1.36.1)

You can read about it here - Using Genymotion Emulator with Flutter in VS Code — (Without Android Studio)

Open up Genymotion and go to the ADB Setting section:

Notice how the default selection is “Use Genymotion Android Tools (default)”? With this selection, the emulator is not recognized.

Change it to “Use custom Android SDK tools”, set the SDK location to where your SDK is (in my case it’s at “C:\Program Files (x86)\Android\android-sdk”). Make sure the tick mark (“This folder is valid”) is displayed.

Close the settings box. Now reload your “VS Code” IDE.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!