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

前端 未结 16 833
南笙
南笙 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:15

    You do not need Android Studio to create or run a Virtual Device. Just use sdkmanager and avdmanager from the android sdk tools.

    Use the sdkmanager to download a system image of Android for x86 system.
    e.g. sdkmanager "system-images;android-21;default;x86_64"

    Then create a new virtual device using avdmanager.
    e.g. avdmanager create avd --name AndroidDevice01 --package "system-images;android-21;default;x86_64"

    Then run the new virtual device using emulator. If you don't have it just install it using the sdkmanager.
    e.g. emulator -avd AndroidDevice01

    If you restart VSCode and load your Flutter project. The new device should show up at the bottom right of the footer.

提交回复
热议问题