Open shiyuanxiang opened 1 year ago
Are you instrumenting from source or from the apk? However as written here https://github.com/H2SO4T/COSMO#cosmo-from-apk-usage COSMO can instrument only certain debug apks (have a look to the paper for more information ). I suggest you to instrument apps from source code.
Thanks for your answer! I have instrumented from both debug-apk and release-apk, but got the error still. And how do I instrument apps from source code?😊
To instrument from source code:
1: Download an Android project (e.g., https://github.com/AntennaPod/AntennaPod)
2: copy the path to the Android project (e.g., /Users/andreronda/Downloads/MyProject
)
3: from the Cosmo folder launch the command python3 cli.py /Users/andreronda/Downloads/MyProject
download the AntennaPod in dir:C:\Users\syx\Desktop\garbage\AntennaPod-develop run cmd in COSMO dir: python cli.py C:\Users\syx\Desktop\garbage\AntennaPod-develop output: Is that means the Instrumentation successful or not? If successful, where is the instrumented files?
I have created this apk already instrumented, please try it [test.apk]()
It can't be download
never mind
download the AntennaPod in dir:C:\Users\syx\Desktop\garbage\AntennaPod-develop run cmd in COSMO dir: python cli.py C:\Users\syx\Desktop\garbage\AntennaPod-develop output: Is that means the Instrumentation successful or not? If successful, where is the instrumented files?
Yes now it is instrumented!
never mind
download the AntennaPod in dir:C:\Users\syx\Desktop\garbage\AntennaPod-develop run cmd in COSMO dir: python cli.py C:\Users\syx\Desktop\garbage\AntennaPod-develop output: Is that means the Instrumentation successful or not? If successful, where is the instrumented files?
Yes now it is instrumented!
So I shall build a debug-apk from the AntennaPod project, and use the debug-apk in ARES?
exactly, now you can build the apk using Android Studio!
Thank you very much! I have sucessfully got the .ec files, but if how could I calculate the code coverage from the .ec files?
Here is the result with cmd: cat xx.ec
Read the readme in the home page under the section: Generating a HTML/CSV report https://github.com/H2SO4T/COSMO#generating-a-htmlcsv-report
command: python .\cli.py path_to_my.apk (I tried several apps, official and my own. Both got the error below.) 18/10/2022 22:52:40> [ERROR][apk_instrumenter][instrument_apk()] Error during Java to Dalvik conversion command: Uncaught translation error: com.android.dx.cf.code.SimException: expected type long[] but found double[] 1 error; aborting