我正在尝试建立和运行的项目在iOS和网络从VS代码。有没有办法做到这一点?
我尝试过运行flutter run -d all,但它只运行iOS,尽管flutter devices列出了这两个命令
发布于 2021-05-06 03:20:12
是的,你可以在你的.vscode/launch.json中创建一个复合启动配置。这个应用程序创建了三个配置,一个在当前设备上启动(显示在状态栏中),一个在iOS上启动,还有一个在安卓上启动。然后它会创建一个复合配置,可以同时在iOS和安卓设备上运行。您可以将其中一个设备ID更改为chrome,以便在Chrome上启动。
{
"version": "0.2.0",
"configurations": [
{
"name": "Current Device",
"request": "launch",
"type": "dart"
},
{
"name": "Android",
"request": "launch",
"type": "dart",
"deviceId": "android"
},
{
"name": "iPhone",
"request": "launch",
"type": "dart",
"deviceId": "iphone"
},
],
"compounds": [
{
"name": "All Devices",
"configurations": ["Android", "iPhone"],
}
]
}更多信息可以在on the Flutter wiki上找到。
https://stackoverflow.com/questions/63492911
复制相似问题