nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

Possible issues with breakpoint debugging

Open rdlauer opened this issue 6 years ago • 5 comments

Via a conversation I had with /u/morginez on reddit (after seeing this comment thread), this person reported some potential issues with breakpoints not being hit (or hit in an unexpected order):

Back then the debugging never really worked at all and I tried to get around it using console.log()-calls.

Breakpoints wouldn't be hit or were hit in a weird, desync-order from what actually happened in the code. I could not really work with the debugging tools at that point.

He has provided a repo of the problem app as well: https://github.com/tihansen/words-challenge/tree/master/app

rdlauer avatar Aug 30 '19 15:08 rdlauer

Note that I'm unsure if this applies to Chrome Dev Tools or VS Code extension - checking with user, might have to move this issue to another repo :)

rdlauer avatar Aug 30 '19 17:08 rdlauer

I managed to reproduce problems with the attached project when trying to debug on iOS. The project crashes on iOS so when trying to execute tns debug iOS --debug-brk the debugger cannot attach at all and cli throws: Cannot connect to device socket. The error message is 'Timeout while waiting for lock "/Users/test/.local/share/.nativescript-cli/1351a495d63521927464972b906f9356"'. NativeScript debugger was not able to get inspector socket port on device 859F156F-01E4-42E9-823A-2E843CB71AAB for application org.nativescript.blankng. Cannot connect to device socket. The error message is 'Device socket port cannot be found.'. We will have to investigate it further.

endarova avatar Sep 05 '19 12:09 endarova

Hey guys,

We investigated the problem and were able to reproduce the above mentioned error:

NativeScript debugger was not able to get inspector socket port on device 859F156F-01E4-42E9-823A-2E843CB71AAB for application org.nativescript.blankng

Let's me first explain in short how NativeScript CLI establishes a debugging session with an application on device. When the application is started, it logs the port of inspector socket. NativeScript CLI parses the logs from device and searches for the mentioned port. When the port is found, NativeScript CLI connects to that port and establishes a debugging session. However, when the application is not successfully started on device or crashes runtime at startup, NativeScript CLI timeouts with the above mentioned error as it is not able to get inspector socket and cannot create a debugging session.

After digging into the problem, it turns out that we had built the application with some beta version of Xcode. After building the application with the latest official Xcode, we were not able to reproduce the error anymore. So, can you please execute the following steps on your side and check if that'll resolve the problem:

  1. Update to the latest official Xcode 11
  2. rm -rf platforms
  3. tns debug ios --debug-brk

If the problem is still not resolved with the above steps, can you send us the followings:

  • Exact steps you're executing on your side
  • The logs from the executed command - tns debug ios --debug-brk --log trace

Fatme avatar Oct 09 '19 06:10 Fatme

Same error with NS 7.3

vallemar avatar Mar 23 '21 22:03 vallemar

Getting error i. 8.1 see my bug report.

mrwrighty avatar Dec 16 '21 11:12 mrwrighty