我使用的是VS Code。在一些为web构建flutter的实验之后,它开始为web构建每个项目都是默认的。我需要拿回它的默认Android版本。
PS D:\code\2019\dart_app1\app1> flutter devices
2 connected devices:
Windows • Windows • windows-x64 • Microsoft Windows [Version 10.0.17134.984]
Chrome • chrome • web-javascript • Google Chrome 76.0.3809.132>PS D:\code\2019\dart_app1\app1> flutter emulators
3 available emulators:
Nexus_5X_API_29 • Nexus 5X API 29 • Google • android
Nexus_9_API_28 • Nexus 9 API 28 • Google • android
flutter_emulator • flutter emulator • Google • android
To run an emulator, run 'flutter emulators --launch <emulator id>'.
To create a new emulator, run 'flutter emulators --create [--name xyz]'.
You can find more information on managing emulators at the links below:
https://developer.android.com/studio/run/managing-avds
https://developer.android.com/studio/command-line/avdmanagerlaunch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart"
}
]
}发布于 2019-09-11 18:27:26
使用args参数在launch.json文件中指定您的设备:
{
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart",
"args": ["-d", "<device name from adb devices output>"]
}
]
}或从右侧的vscode底部面板中选择。默认情况下,launcher会选择第一个可用的设备,而chrome device可能总是如此。
https://stackoverflow.com/questions/57886563
复制相似问题