gpt4 book ai didi

flutter - 将默认构建目标从 flutter for web 更改为 flutter for Android

转载 作者:行者123 更新时间:2023-12-03 13:31:08 25 4
gpt4 key购买 nike

我正在使用 VS 代码。在为 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/avdmanager

启动.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"
}
]
}

最佳答案

launch.json 中指定您的设备文件与 args范围:

{
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart",
"args": ["-d", "<device name from adb devices output>"]
}
]
}

或从 vscode 中选择右侧的底部面板。默认情况下,启动器选择第一个可用设备,然后 chrome device可能总是那样。

关于flutter - 将默认构建目标从 flutter for web 更改为 flutter for Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57886563/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com