nativescript-community / nativescript-vscode-extension

A Visual Studio Code Extension for NativeScript
https://www.nativescript.org/visual-studio-code
Apache License 2.0
82 stars 32 forks source link

Mac OS Monterey + IOS Simulator. Debugger isn't attached. #293

Closed valera1401 closed 3 months ago

valera1401 commented 2 years ago

Run the app with VS Code "Launch on IOS".

Got the output:

Opened localhost 41000

To start debugging, open the following URL in Chrome: devtools://devtools/bundled/inspector.html?ws=localhost:41000

Successfully synced application org.nativescript.HelloWorld on device 5918A21E-3828-4893-9EEC-05053567499F.

[NSDebugAdapter] Ready to attach to application on 41000

Debugging is stopped

Open the link in Google Chrome devtools://devtools/bundled/inspector.html?ws=localhost:41000

Click "Reconnect DevTools" multiple times. What I've noticed is that interval between reconnections is increased with the next reconnection.

Run the app with VS Code "Launch on IOS". Debugging is working.

We couldn't reproduce the behavior on mac with Big Sur OS version.

meeshkabob commented 1 year ago

I also have this issue on macOS Ventura. It is not possible to debug iOS using Nativescript VS Code Extension.

I created a new Angular Nativescript project using the nativescript command ns create, and then generated a new nativescript launch.json file in VS Code. Whether I attempt to attach the debugger to the already running app on my iOS simulator, or attempt to launch on iOS, the debugger does not attach.

Environment:

Nativescript VS Code Extension v0.12.3
macOS 13.1 (22C65)
Nativescript 8.4.0
VS Code 1.75.1 

The console logging:

[NSDebugAdapter] Ready to attach to application on 41000

[NSDebugAdapter] Using tns CLI on path 'tns'

[NSDebugAdapter] Running tns command...

[NativeScriptCli] execute: tns --analyticsClient VSCode debug ios --start 
[NSDebugAdapter] Watching the tns CLI output to receive a connection token

Searching for devices...

Setting up debugger proxy...
Press Ctrl + C to terminate, or disconnect.

Opened localhost 41000

To start debugging, open the following URL in Chrome:
devtools://devtools/bundled/inspector.html?ws=localhost:41000


[NSDebugAdapter] Ready to attach to application on 41000

Contents of launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch on iOS",
            "type": "nativescript",
            "request": "launch",
            "platform": "ios",
            "appRoot": "${workspaceRoot}",
            "sourceMaps": true,
            "watch": true
        },
        {
            "name": "Test on iOS",
            "type": "nativescript",
            "request": "launch",
            "platform": "ios",
            "appRoot": "${workspaceRoot}",
            "sourceMaps": true,
            "watch": false,
            "stopOnEntry": true,
            "launchTests": true,
            "tnsArgs": [
                "--justlaunch"
            ]
        },
        {
            "name": "Attach on iOS",
            "type": "nativescript",
            "request": "attach",
            "platform": "ios",
            "appRoot": "${workspaceRoot}",
            "sourceMaps": true,
            "watch": false
        },
        {
            "name": "Launch on Android",
            "type": "nativescript",
            "request": "launch",
            "platform": "android",
            "appRoot": "${workspaceRoot}",
            "sourceMaps": true,
            "watch": true
        },
        {
            "name": "Test on Android",
            "type": "nativescript",
            "request": "launch",
            "platform": "android",
            "appRoot": "${workspaceRoot}",
            "sourceMaps": true,
            "watch": false,
            "stopOnEntry": true,
            "launchTests": true,
            "tnsArgs": [
                "--justlaunch"
            ]
        },
        {
            "name": "Attach on Android",
            "type": "nativescript",
            "request": "attach",
            "platform": "android",
            "appRoot": "${workspaceRoot}",
            "sourceMaps": true,
            "watch": false
        }
    ]
}
cbtham commented 1 year ago

Same problem as well. MacOS ventura debugging in vscode doesnt work at all

meeshkabob commented 11 months ago

VSCode debugging for iOS is still not functional in my environment. Both Launch on iOS and Attach on iOS conclude with output, [NSDebugAdapter] Ready to attach to application on 41000.

Any advice or suggestions would be appreciated.

Environment:

Nativescript VS Code Extension v0.12.3
macOS Ventura 13.5.1
Nativescript 8.5.3
VS Code 1.81.1
Simulator: iPhone 14 Pro Max, iOS 16.4
valera1401 commented 11 months ago

VSCode debugging for iOS is still not functional in my environment. Both Launch on iOS and Attach on iOS conclude with output, [NSDebugAdapter] Ready to attach to application on 41000.

Any advice or suggestions would be appreciated.

Environment:

Nativescript VS Code Extension v0.12.3
macOS Ventura 13.5.1
Nativescript 8.5.3
VS Code 1.81.1
Simulator: iPhone 14 Pro Max, iOS 16.4

Open in browse debug link from console. Click "Reconnect" button about ten times. VS Code debug should work after that.

vallemar commented 7 months ago

Same here, not working

vallemar commented 3 months ago

Fixed in v0.12.4 https://github.com/nativescript-community/nativescript-vscode-extension/pull/297

meeshkabob commented 3 months ago

It works! Thank you, major quality of life improvement.