2

I try to run bugreport from Runtime exec and I get the following error:

FAIL:Failed to connect to dumpstate service: No such file or directory

I looked into bugreport code here , and it looks like it failed to open a tcp socket to dumpstate service. I also investigated that when com.android.settings asks for a bugreport it uses ActivityManagerService function "requestBugReport" as you can see here, the system set property to start a service but I fail to that also. I tried to reflect this method but for some reason this "ActivityManagerService" class not found.

 val check = Class
        .forName("com.android.server.am.ActivityManagerService")
        .getMethod("requestBugReport")
        .invoke(null)

Is there anyway to get the output of bugreport/bugreportz?

Zach Bublil
  • 857
  • 10
  • 28
  • Hi Zach, did you managed to fix this error? I'm having the same problem, and the internet seems to be not aware of this problem. Except this post. – MRodrigues Jan 20 '21 at 17:00
  • That's possibly a permissions issue, only shell,system and sometimes root can execute bugreport – Zach Bublil Feb 26 '21 at 15:30

1 Answers1

0

you may need the "android.os.BugreportManager" class provided by google android sdk.

rayway
  • 1
  • 1
    Welcome to Stack Overflow! Please phrase this as an explained conditional answer, in order to avoid the impression of asking a clarification question instead of answering (for which [a comment should be used instead of an answer](https://meta.stackexchange.com/questions/214173)). For example like "If your problem is ... then the solution is to .... because .... ." – Adriaan Mar 23 '23 at 10:27