Skip to content

Unable to reconnect to iOS Simulator when debugging #3840

@rosen-vladimirov

Description

@rosen-vladimirov

Tell us about the problem

During tns debug ios on iOS Simulator, in case you apply a change in the code, the application is restarted and Chrome DevTools are disconnected. After CLI prints a new URL, you should reconnect the DevTools. In case you try to connect immediately when CLI prints the URL, the DevTools will not connect.
This is not a big issue for CLI, but it breaks the behavior in VSCode extension and NativeScript Sidekick, which refresh the DevTools on their own immediately when they receive the new URL. This breaks the debug behavior in these two clients.

Which platform(s) does your issue occur on?

iOS (specifically on Simulator)

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.2.2
  • Cross-platform modules: Not applicable
  • Runtime(s): latest 4.2.x
  • Plugin(s): Not applicable

Please tell us how to recreate the issue in as much detail as possible.

The easiest way is to use NativeScript Sidekick.
Try run on simulator with Start Debugger enabled. After it starts, apply a change in your code. When CLI LiveSyncs, the DevTools will be refreshed, you'll see again the Reconnect Dev Tools button and in the output pane you'll see:

Frontend client connected.
Backend socket created.
Backend socket closed.
Fronted client closed.

Instead, you should see only the first two messages.

Another way to reproduce it is to use CLI:

  1. tns debug ios
  2. Open the URL
  3. Apply a change in the code
  4. Immediately when you see a new URL in CLI's output refresh the browser - it should reconnect, but instead it fails.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions