Wednesday, 9 October 2019

Android Service - why wait for debugger and then attach debugger to process?

What is the significance of

android.os.Debug.waitForDebugger();

I am aware that we [sometimes] need to do this in order to debug a Service, but my question is:

  • WHY do we have to do this?
  • Why does this method exist? What other purpose does it serve?
  • What does it mean to attach a debugger to a process, and why do we have to do this? Why does a Service have to be debugged in this way, and not an Activity or BroadcastReceiver?

References:

1. Debugging a service.

2. A proper way to Debug a Service in Android Studio?.

3. Breakpoint in service not working.

4. How to debug an Android Background Service?.

5. How to debug a Service?.

6. Configure on-device developer options.



from Android Service - why wait for debugger and then attach debugger to process?

No comments:

Post a Comment