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
107 stars 30 forks source link

INSTRUMENTATION_CODE=0 during "acv start <package-name>" #46

Open rakin000 opened 1 month ago

rakin000 commented 1 month ago

I've followed this. But when I execute the acv start com.aimp.player , I get the following error.


> acv start com.aimp.player

Press Ctrl+C to finish ...
INSTRUMENTATION_RESULT: shortMsg=Process crashed.
INSTRUMENTATION_CODE: 0

OS: Ubuntu 24.04 Virtual Env Manager: Conda Device: Samsung Galaxy A05 adb version info :

Android Debug Bridge version 1.0.41
Version 34.0.4-debian
Installed as /usr/lib/android-sdk/platform-tools/adb
Running on Linux 6.8.0-45-generic (x86_64)

aapt2, apksigner, zipalign version : 35.0.0 ACVPatcher version : v1.0.3

pilgun commented 1 month ago

Hey Rakin000, the video is too old, no need to run acv start anymore.

Follow the new workflow

$ acv activate com.gnsdm.snake
$ acv snap com.gnsdm.snake
$ acv cover-pickles com.gnsdm.snake
$ acv report com.gnsdm.snake
srbd2024 commented 1 month ago

Hey Rakin000, the video is too old, no need to run acv start anymore.

Follow the new workflow

$ acv activate com.gnsdm.snake
$ acv snap com.gnsdm.snake
$ acv cover-pickles com.gnsdm.snake
$ acv report com.gnsdm.snake

Somehow I am not getting the "pickle" files after acv snap com.gnsdm.snake and acv cover-pickles com.gnsdm.snake gives following error

Traceback (most recent call last):
  File "~/miniconda3/bin/acv", line 33, in <module>
    sys.exit(load_entry_point('acvtool', 'console_scripts', 'acv')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/Desktop/acvtool/acvtool/acvtool.py", line 89, in main
    run_actions(parser, args)
  File "~/Desktop/acvtool/acvtool/acvtool.py", line 47, in run_actions
    acv.cover_pickles(args)
  File "~/Desktop/acvtool/acvtool/smiler/acv.py", line 97, in cover_pickles
    coverage.cover_pickles(wd)
  File "~/Desktop/acvtool/acvtool/smiler/operations/coverage.py", line 23, in cover_pickles
    pkl_path = covered_pkls[dex] if covered_pkls else pkls[dex]
                                                      ~~~~^^^^^
KeyError: 1
pilgun commented 1 month ago

Perhaps you could remove everything from ~/acvtool/acvtool_working_dir/ and try again?

srbd2024 commented 1 month ago

Perhaps you could remove everything from ~/acvtool/acvtool_working_dir/ and try again?

Yes, I've tried that. Also I tried after reinstalling acvtool but no success. Still got the same problem.

Actually the problem was that it needs pickles files from instrumentation process. snap, cover-pickles and report sub-commands are needed to be run on the same working directory.

Thanks a lot.