Skip to content

Possible issues with breakpoint debugging #5000

Open
@rdlauer

Description

@rdlauer

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

Activity

rdlauer

rdlauer commented on Aug 30, 2019

@rdlauer
ContributorAuthor

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 :)

self-assigned this
on Sep 2, 2019
added this to the 6.2.0 milestone on Sep 5, 2019
endarova

endarova commented on Sep 5, 2019

@endarova
Contributor

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.

self-assigned this
on Sep 16, 2019
Fatme

Fatme commented on Oct 9, 2019

@Fatme
Contributor

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
removed this from the 6.2.0 milestone on Nov 1, 2019
vallemar

vallemar commented on Mar 23, 2021

@vallemar
Contributor

Same error with NS 7.3

mrwrighty

mrwrighty commented on Dec 16, 2021

@mrwrighty

Getting error i. 8.1 see my bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Fatme@rdlauer@KristianDD@endarova@mrwrighty

      Issue actions

        Possible issues with breakpoint debugging · Issue #5000 · NativeScript/nativescript-cli