1

I want to run my flutter app on web and in emulator simultaneously in VS Code. But I am only able to run it in either web or emulator one by one but not simultaneously.

1
  • You can try opening two VS Code instances, would that do the trick?
    – Phake
    Commented Mar 3, 2021 at 16:37

1 Answer 1

3

You can create a compound launch config in your .vscode/launch.json that launches two configs that each specify a deviceId.

This one creates three configs, one to launch on the current device (shown in the status bar), one to launch on iOS, and one to launch on Android. It then creates a compound config that will launch on iOS and Android devices at the same time. You can change one of the device IDs to chrome to launch on 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"],
        }
    ]
}

More info can be found on the Flutter wiki.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.