-1

Hi i need to do some coverage testing on android apk files. I do not have access to the source. Are there any such tools that will allow me to view the method calls in the apk file run-time? so that I can do some functional coverage analysis? I heard that some tool like emma does that for java jar files. so are there any ways for apk files? I want to run the apk in phone or simulator and watch the method calls/ or get the report of method calls.

So here is my goal, while running the app with apk, i want a coverage report of the methods called. Now if emma can work with apk that will be nice. cause i can convert apk to jar file. but i cannot run the jar just like the apk, so running emma on the jar will not help me i guess.

P basak
  • 4,874
  • 11
  • 40
  • 63
  • Take a look at [this post](http://stackoverflow.com/questions/1249973/decompiling-dex-into-java-sourcecode) to decompile the app and access it's source code! – Samer Sep 19 '12 at 20:46
  • @SAmZz decompiling the source code won't directly help you with testing. Once you know things like method names, you still need to test them, and you can use EMMA for this, which can also (I believe) you lists of methods via reflection.. – Kristopher Micinski Sep 19 '12 at 20:50
  • @Pbasak, you want to look at the `Instrumentation` capabilities (and robotium). This is how you would go about doing this.. – Kristopher Micinski Sep 19 '12 at 20:59

1 Answers1

0

You can indeed use EMMA for Android:

You can use Instrumentation and robotium for testing other pieces of your Android project, to investigate the GUI behavior, even if you don't have source for the Application.

Kristopher Micinski
  • 7,572
  • 3
  • 29
  • 34
  • It's unclear what you mean with the source for APKs. How are you going to link against the code if you don't have the source? The only way to do this is to diassemble the APK and then link your EMMA code with it (so, decompiling it). However, you can use robotium without source. – Kristopher Micinski Sep 19 '12 at 20:54
  • hi i updated the question, please have a look to know whether it is clear to you now, i can decompile the code, but to test for method calls i need the app running, so how can i get the decompiled code running? I need to just have the list of methods called. – P basak Sep 19 '12 at 20:59