Skip to content

Debug on Android fails when stopped on breakpoint and change in .xml/.css/.html is applied #1243

@KristianDD

Description

@KristianDD

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.1.0
  • Cross-platform modules: 5.1.0
  • Android Runtime: 5.1.0

Describe the bug

If tns debug android command is executed and a breakpoint is hit, any sync operation will cause the command to exit with unsuccessful sync operation.

To Reproduce

  1. tns debug android
    2, Modify an xml file

Expected behavior
The sync should complete successfully and changes will be present at least after the continue button is hit.

Additional context

It seems that executing the livesync.js file here blocks the sync thread and the CLI doesn't receive the status report which is sent here until the breakpoint is released. The issue is that the CLI has a limit on how much time to wait for the compleation of the task.

We can try using some inspector api to evaluate the content of the livesync.js file (seems that the ios-runtime uses similar approach). For example this api .

As a last resort we can extract the execution of the script in a separate thread and if the thread is alive we don't create new one. This way only one execution of the script will happen, even if we had more than one livesync.

Related to: NativeScript/nativescript-cli#4227

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions