I'm trying to debug a flutter app using VSCode but it doesn't find any devices and show the message Cannot launch without an active device.
I can launch the app using the command flutter run --no-sound-null-safety from the terminal but I want to do it using the VSCode debug tool.
Specs:
my launch.json file:
{
"configurations": [
{
"name": "Flutter",
"program": "lib/main.dart",
"request": "launch",
"type": "dart",
"console": "terminal",
"args": ["--no-sound-null-safety"],
}
]
}
my settings.json file:
{
"dart.flutterAdditionalArgs": [
"--no-sound-null-safety"
],
"dart.vmAdditionalArgs": [
"--no-sound-null-safety"
],
}
The problem is because the Xcode no setting the locations to command-line tools:
Go to preferences > locations > Command Line Tools
then select Xcode xx

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With