Skip to content

fix: enable debug-brk on real iOS devices #4296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 22, 2019

Conversation

DimitarTachev
Copy link
Contributor

@DimitarTachev DimitarTachev commented Jan 17, 2019

and do not make an additional restart in the debug services.

PR Checklist

What is the current behavior?

Debug

  • we are not able to use --debug-brk on a real iOS device

Unit testing

  • tns test <platform> --debug-brk is not working without --no-watch
  • tns test <platform> --debug-brk --no-watch is throwing an exception
  • tns test <platform> --debug-brk is not working with multiple devices
  • tns test <platform> --debug-brk is not printing the debug URL
    -- tns dev-test <platform> is throwing an exception

Common issues

  • we are not able to kill the CLI with CTRL + C for 10 seconds after initial livesync.
  • we are allowing simultaneously CTRL + C handlers in the livesync service.

What is the new behavior?

Debug

  • we are able to use --debug-brk on a real iOS device

Unit testing

  • tns test <platform> --debug-brk is working as expected
  • tns dev-test <platform> is removed

Common issues

  • we are able to kill the CLI with CTRL + C just after the initial livesync
  • we are not allowing simultaneously CTRL + C handlers in the livesync service.

Refactoring

  • the iOS devices are exposing only getDebugSocket method as we use the debug protocol for the LiveSync refresh method.
  • the lldb process spawning in moved in the ios-simulator-application-manager as its an application start related logic.
  • remove the IHasHasReconnected flag of the debug services as they are not restarting the application anymore.
  • remove the prepareForLiveSync method as it was making a redundant attachToDebuggerPortFoundEvent call.
  • remove the debugStart methods from the debug services as they were wrongly used in the unit testing.
  • remove a startLookingForDevices call from the android debug service as we are ensuring this in all commands.
  • remove $devicesService.initialize and $devicesService.execute calls from the debug services as we are ensuring the initialization in all commands are the debug services are always working with a single device.
  • we are now starting the device log process and attaching to the DebuggerPortFound event only when we need it (when connecting to the debug socket).
  • the --debug-brk logic is moved to the application managers in order to allow a single app start for the livesync and debug operations.
  • the debug services are not restarting the application anymore. The code is prepared for moving this restart to a single place in the LiveSync service where we will be able to emit the DEBUGGER_DETACHED_EVENT_NAME and fix the regression from 5.1.0.

Related to: #3122, #3161

@DimitarTachev DimitarTachev force-pushed the tachev/fix-ios-debug-brk branch 8 times, most recently from 58ab789 to a23d79f Compare January 18, 2019 15:51
@DimitarTachev DimitarTachev force-pushed the tachev/fix-ios-debug-brk branch from a23d79f to 3751da0 Compare January 21, 2019 09:59
- remove enableDebugging options as its misleading, we will always create the `debugger-started` file as the runtime will update it only if the app is debuggable
- make the `waitForDebugger` argument of the `startApplication` method optional in order to simplify its usage
- remove the pid from `startApplication` as we are not using it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants