pilgun / acvtool

ACVTool (Android Code Coverage Tool) is a tool to measure fine-grained code coverage of 3rd-party Android apps.
Apache License 2.0
101 stars 30 forks source link

How does acvtool handle crashes? #8

Closed skyridertk closed 4 years ago

skyridertk commented 5 years ago

What is this supposed to mean? INSTRUMENTATION_RESULT: shortMsg=keyDispatchingTimedOut INSTRUMENTATION_RESULT: longMsg=Input dispatching timed out (Waiting because no window has focus but there is a focused application that may eventually add a window when it finishes starting up.) INSTRUMENTATION_CODE: 0

It seems to me if the application under test crashes, acvtool also crashes...no more reports. How does it handle crashes then?

pilgun commented 5 years ago

AcvInstrumentation.smali overrides onException to handle app-level exceptions and save it into errors.txt file. See documentation here https://developer.android.com/reference/android/app/Instrumentation (onException). I believe it will not handle crashes related to system.

keyDispatchingTimedOut most probably occurs because of too many events injected. Android system can't process too many events and freezes. If you run monkey to generate events give it throttle parameter (at least 0.5 seconds).

skyridertk commented 5 years ago

@pilgun How can I check the number of crashes using acvtool? I recall you mentioned that the tool records code coverage and crashes. I cannot find anywhere on the reports generated that states the crashes;

skyridertk commented 5 years ago

@pilgun

AcvInstrumentation.smali overrides onException to handle app-level exceptions and save it into errors.txt file. See documentation here https://developer.android.com/reference/android/app/Instrumentation (onException). I believe it will not handle crashes related to system.

Hmm the error shows up during testing phase...the acvtool stops...but the tests keep going on. Is there a way to continue running acvtool after those errors come out?

pilgun commented 5 years ago

If there was an error and both acvtool and the app have stopped, there is no sense to continue testing, is it? If the app continues running but only instrumentation process stopped, then it is a problem either with acvtool or with your testing pipeline that can stop instrumentation process for some reason. If you say, the that manually everything works fine, then there is a conflict with that testing tool.