Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode does't recognize iOS Simulator

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:

  • macOS Big Sur 11.3
  • VSCode 1.58.1
  • Simulator iPhone 12, iOS 14.5
  • XCode 12.5.1

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"
    ],
}
like image 569
user2289947 Avatar asked Dec 01 '25 03:12

user2289947


1 Answers

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 enter image description here

like image 192
Jacky Pham Avatar answered Dec 02 '25 19:12

Jacky Pham