I'd like to use Visual Studio Code as my editor for Flutter development, but I don't know how to get the emulator going. I've installed Visual Studio Code on Ubuntu 17.10 (Artful Aardvark).
I followed the first half of instructions as outlined on the Flutter: Get Started page (Create new app). Then I ran into trouble in the second half:
Run the app
- Make sure a target device is selected in the lower, right-hand corner of VS Code
- Press the F5 button on the keyboard, or invoke Debug>Start Debugging
- Wait for the app to launch
- If everything works, after the app has been built, you should see your starter app on your device or simulator:
The problem is that in that bottom right-hand corner is "No Devices."
How do I connect a device? I can't seem to find instructions anywhere.
Step 1: Go to the Extensions button on VSCode and search for Android and iOS Emulator and install it. Note: Change the Emulator path windows address based on the location of the emulator file on your PC but make the Emulator path as default it would be given as default by the VSCode.
From version 2.13.0
of Dart Code, emulators can be launched directly from within Visual Studio 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 development and beta channels.
I tested this feature, and it worked very well on Flutter version 0.5.6-pre.61 (master channel).
Do Ctrl + Shift + P
Then type Flutter:launch emulator
or
run this command in your Visual Studio 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 haven't installed any emulator you can install one with flutter emulators --create [--name xyz]
, and then run your project flutter run
inside the root directory of the project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With