Android: dalvik killing app due to ANR when in debugger breakpoint Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Canvas and surfaceView example crash/freeze - Memory Leak?Debugger gets disconnected during debug when Broadcastreceiver timeout occursUsing setText results in Source not foundAndroid app crashes with SIGABRT Signal 6 only while Eclipse debuggingjava.lang.String cannot be converted to JSONObjectMockito + Dexmaker test crashes when run on Android < 4.4Android kills app when debugging push notificationsLenovo P70-A have ADB connection (Android Studio) but not stoping on any breakpointsAndroid SQLite-->StackOverflowErrorUnable to debug a Spring Boot App. The breakpoints always escape

Can an alien society believe that their star system is the universe?

Why does it sometimes sound good to play a grace note as a lead in to a note in a melody?

Denied boarding although I have proper visa and documentation. To whom should I make a complaint?

What do you call the main part of a joke?

How to write the following sign?

Are all finite dimensional hilbert spaces isomorphic to spaces with Euclidean norms?

Question about debouncing - delay of state change

Dating a Former Employee

Using et al. for a last / senior author rather than for a first author

Trademark violation for app?

The code below, is it ill-formed NDR or is it well formed?

Why do we bend a book to keep it straight?

Localisation of Category

If windows 7 doesn't support WSL, then what does Linux subsystem option mean?

Why wasn't DOSKEY integrated with COMMAND.COM?

Is there hard evidence that the grant peer review system performs significantly better than random?

Why doesn't SQL Optimizer use my constraint?

Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?

As a beginner, should I get a Squier Strat with a SSS config or a HSS?

How often does castling occur in grandmaster games?

Sum letters are not two different

Should I follow up with an employee I believe overracted to a mistake I made?

How fail-safe is nr as stop bytes?

Disembodied hand growing fangs



Android: dalvik killing app due to ANR when in debugger breakpoint



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Canvas and surfaceView example crash/freeze - Memory Leak?Debugger gets disconnected during debug when Broadcastreceiver timeout occursUsing setText results in Source not foundAndroid app crashes with SIGABRT Signal 6 only while Eclipse debuggingjava.lang.String cannot be converted to JSONObjectMockito + Dexmaker test crashes when run on Android < 4.4Android kills app when debugging push notificationsLenovo P70-A have ADB connection (Android Studio) but not stoping on any breakpointsAndroid SQLite-->StackOverflowErrorUnable to debug a Spring Boot App. The breakpoints always escape



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















On an Android 4.3 embedded (custom) device, I am trying to debug my app by setting a breakpoint in a Service sub-class onStartCommand method. When I am paused at the breakpoint dalvik kills my app due to ANR not realizing that I am debugging.



The logcat shows:



W/ANRWatchdog: An ANR was detected but ignored because the debugger is connected (you can prevent this with setIgnoreDebugger(true))
I/dalvikvm: threadid=3: reacting to signal 3
D/dalvikvm: threadid=1: still suspended after undo (sc=1 dc=1)
I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'


Notice that I have an ANRWatchDog in my app which correctly recognizes the debug session and ignores the ANR.



Is theer a way to do the same with Dalvik? I am assuming it is possible to debug a Service without crashing due to ANR.










share|improve this question






























    0















    On an Android 4.3 embedded (custom) device, I am trying to debug my app by setting a breakpoint in a Service sub-class onStartCommand method. When I am paused at the breakpoint dalvik kills my app due to ANR not realizing that I am debugging.



    The logcat shows:



    W/ANRWatchdog: An ANR was detected but ignored because the debugger is connected (you can prevent this with setIgnoreDebugger(true))
    I/dalvikvm: threadid=3: reacting to signal 3
    D/dalvikvm: threadid=1: still suspended after undo (sc=1 dc=1)
    I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
    Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'


    Notice that I have an ANRWatchDog in my app which correctly recognizes the debug session and ignores the ANR.



    Is theer a way to do the same with Dalvik? I am assuming it is possible to debug a Service without crashing due to ANR.










    share|improve this question


























      0












      0








      0








      On an Android 4.3 embedded (custom) device, I am trying to debug my app by setting a breakpoint in a Service sub-class onStartCommand method. When I am paused at the breakpoint dalvik kills my app due to ANR not realizing that I am debugging.



      The logcat shows:



      W/ANRWatchdog: An ANR was detected but ignored because the debugger is connected (you can prevent this with setIgnoreDebugger(true))
      I/dalvikvm: threadid=3: reacting to signal 3
      D/dalvikvm: threadid=1: still suspended after undo (sc=1 dc=1)
      I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
      Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'


      Notice that I have an ANRWatchDog in my app which correctly recognizes the debug session and ignores the ANR.



      Is theer a way to do the same with Dalvik? I am assuming it is possible to debug a Service without crashing due to ANR.










      share|improve this question
















      On an Android 4.3 embedded (custom) device, I am trying to debug my app by setting a breakpoint in a Service sub-class onStartCommand method. When I am paused at the breakpoint dalvik kills my app due to ANR not realizing that I am debugging.



      The logcat shows:



      W/ANRWatchdog: An ANR was detected but ignored because the debugger is connected (you can prevent this with setIgnoreDebugger(true))
      I/dalvikvm: threadid=3: reacting to signal 3
      D/dalvikvm: threadid=1: still suspended after undo (sc=1 dc=1)
      I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
      Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'


      Notice that I have an ANRWatchDog in my app which correctly recognizes the debug session and ignores the ANR.



      Is theer a way to do the same with Dalvik? I am assuming it is possible to debug a Service without crashing due to ANR.







      android debugging dalvik






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 8 at 20:50







      Farrukh Najmi

















      asked Mar 8 at 19:59









      Farrukh NajmiFarrukh Najmi

      2,32722237




      2,32722237






















          1 Answer
          1






          active

          oldest

          votes


















          2














          In developer settings, there is an option called "select debug app". Click on this and select the application you will be debugging. This should prevent any ANRs from occurring for that app, while you are debugging it. It also enables the "wait for debugger" option, which, if enabled, will pause the app as soon as it starts, so you can attach a debugger and debug the applications startup code, if necessary.






          share|improve this answer























          • Thank you. I have a custom Android 4.3 board with many such UI features stripped out. Can the equivalent be done without UI?

            – Farrukh Najmi
            Mar 8 at 21:59











          • You can use "adb shell am set-debug-app my.app.package.name"

            – JesusFreke
            Mar 9 at 0:15











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55070212%2fandroid-dalvik-killing-app-due-to-anr-when-in-debugger-breakpoint%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          In developer settings, there is an option called "select debug app". Click on this and select the application you will be debugging. This should prevent any ANRs from occurring for that app, while you are debugging it. It also enables the "wait for debugger" option, which, if enabled, will pause the app as soon as it starts, so you can attach a debugger and debug the applications startup code, if necessary.






          share|improve this answer























          • Thank you. I have a custom Android 4.3 board with many such UI features stripped out. Can the equivalent be done without UI?

            – Farrukh Najmi
            Mar 8 at 21:59











          • You can use "adb shell am set-debug-app my.app.package.name"

            – JesusFreke
            Mar 9 at 0:15















          2














          In developer settings, there is an option called "select debug app". Click on this and select the application you will be debugging. This should prevent any ANRs from occurring for that app, while you are debugging it. It also enables the "wait for debugger" option, which, if enabled, will pause the app as soon as it starts, so you can attach a debugger and debug the applications startup code, if necessary.






          share|improve this answer























          • Thank you. I have a custom Android 4.3 board with many such UI features stripped out. Can the equivalent be done without UI?

            – Farrukh Najmi
            Mar 8 at 21:59











          • You can use "adb shell am set-debug-app my.app.package.name"

            – JesusFreke
            Mar 9 at 0:15













          2












          2








          2







          In developer settings, there is an option called "select debug app". Click on this and select the application you will be debugging. This should prevent any ANRs from occurring for that app, while you are debugging it. It also enables the "wait for debugger" option, which, if enabled, will pause the app as soon as it starts, so you can attach a debugger and debug the applications startup code, if necessary.






          share|improve this answer













          In developer settings, there is an option called "select debug app". Click on this and select the application you will be debugging. This should prevent any ANRs from occurring for that app, while you are debugging it. It also enables the "wait for debugger" option, which, if enabled, will pause the app as soon as it starts, so you can attach a debugger and debug the applications startup code, if necessary.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 8 at 20:58









          JesusFrekeJesusFreke

          15.8k44860




          15.8k44860












          • Thank you. I have a custom Android 4.3 board with many such UI features stripped out. Can the equivalent be done without UI?

            – Farrukh Najmi
            Mar 8 at 21:59











          • You can use "adb shell am set-debug-app my.app.package.name"

            – JesusFreke
            Mar 9 at 0:15

















          • Thank you. I have a custom Android 4.3 board with many such UI features stripped out. Can the equivalent be done without UI?

            – Farrukh Najmi
            Mar 8 at 21:59











          • You can use "adb shell am set-debug-app my.app.package.name"

            – JesusFreke
            Mar 9 at 0:15
















          Thank you. I have a custom Android 4.3 board with many such UI features stripped out. Can the equivalent be done without UI?

          – Farrukh Najmi
          Mar 8 at 21:59





          Thank you. I have a custom Android 4.3 board with many such UI features stripped out. Can the equivalent be done without UI?

          – Farrukh Najmi
          Mar 8 at 21:59













          You can use "adb shell am set-debug-app my.app.package.name"

          – JesusFreke
          Mar 9 at 0:15





          You can use "adb shell am set-debug-app my.app.package.name"

          – JesusFreke
          Mar 9 at 0:15



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55070212%2fandroid-dalvik-killing-app-due-to-anr-when-in-debugger-breakpoint%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

          Алба-Юлія

          Захаров Федір Захарович