How to set up devices for VS Code for a Flutter emulator

前端 未结 16 738
南笙
南笙 2020-12-23 14:42

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

相关标签:
16条回答
  • 2020-12-23 15:01
    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

    0 讨论(0)
  • 2020-12-23 15:01

    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.

    0 讨论(0)
  • 2020-12-23 15:03

    Genymotion settings -> Select ADB Tab -> Select

    Use custom Android SDK tools -> Add Android SDK Path (Ex: C:\Users\randika\AppData\Local\Android\sdk)

    0 讨论(0)
  • 2020-12-23 15:10

    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)

    0 讨论(0)
  • 2020-12-23 15:10

    set "ANDROID_SDK_ROOT" in environment variable, solve my problem.

    0 讨论(0)
  • 2020-12-23 15:12

    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.

    0 讨论(0)
提交回复
热议问题