Is it possible to get code coverage of my android app using jococo and appium? From what I understand, Appium takes the built apk and uses that for running the tests. So, is there any way around this so that we can enable code coverage?
Yes, it’s possible to get code coverage using Appium. We had similar issue few years back on using Appium and Emma (not Jococo, but I believe your problem can be solved using the same technique used by my team).
To get the instrumentation detail, in console type "adb shell pm list instrumentation" after you installed the instrumented app on to your device/emulator. Copy the whole path
desiredCapabilities.setCapability("androidCoverage", "<instrumentation >");
Call this method when your test case is end and just before you quit the driver.
Also refer to following commits:
Hope this helps.