I\'d like to use VS Code as my editor for Flutter development, but I don\'t know how to get the emulator going. I\'ve installed VS Code on Ubuntu 17.10.
I followed th
ctrl+shift+p
then type Flutter:launch emulator
or
run this command in your VS code terminal flutter emulators
then see the result if you have installed any emulator it will show you , then to run one of them use flutter emulators --launch your_emulator_id
in my case flutter emulators --launch Nexus 6 API 28
but if you havent installed any emulator you can install one with flutter emulators --create [--name xyz]
then run your project flutter run
inside the root directory of the project
Recently i switched from Windows 10 home to Elementary OS, vscode didn't start from ctr+shift+p launch emulator instead of that, i just clicked bottom right corner no device---> Start emulator worked fine.
Genymotion settings -> Select ADB Tab -> Select
Use custom Android SDK tools -> Add Android SDK Path (Ex: C:\Users\randika\AppData\Local\Android\sdk)
From version 2.13.0 of Dart Code, emulators can be launched directly from within Code but This feature relies on support from the Flutter tools which means it will only show emulators when using a very recent Flutter SDK. Flutter’s master channel already has this change, but it may take a little longer to filter through to the dev and beta channels.
I tested this feature and worked very well on flutter version 0.5.6-pre.61 (master channel)
set "ANDROID_SDK_ROOT" in environment variable, solve my problem.
For those people using a Mac you can go to your terminal and type
$ open -a Simulator.app
and this command will open the simulator.
After that, just go to the Debug option and tap on "Start Debugging"
If you want to test with an Android Emulator:
What I did was to go first to Android Studio and open a virtual Device with AVD Manager. After that you'll see another devices in your Visual Studio Code
In the bottom right you'll see now that you have 2 devices connected. Now, you can test with any of this devices.