title: Android Gradle Jacoco: offline instrumentation for integration tests
body: <p>we are building an Android app which is tested by using Appium. Now I would like to see the test coverage of our Appium tests.
  I think this is possible, because Jacoco supports offline instrumentation (<a href="http://www.eclemma.org/jacoco/trunk/doc/offline.html" rel="noreferrer">http://www.eclemma.org/jacoco/trunk/doc/offline.html</a>).</p>
  
  <p>And even the documentation of the jacoco gradle plugin says:</p>
  
  <blockquote>
    <p>While all tasks of type Test are automatically enhanced to provide coverage information when the java plugin has been applied, any task that implements JavaForkOptions can be enhanced by the JaCoCo plugin. That is, any task that forks Java processes can be used to generate coverage information.</p>
  </blockquote>
  
  <p>see <a href="https://docs.gradle.org/current/userguide/jacoco_plugin.html" rel="noreferrer">https://docs.gradle.org/current/userguide/jacoco_plugin.html</a></p>
  
  <p>But how do I have to write the build.gradle so our acceptance debug flavor is instrumented and the exec file is written to the Smartphone when the Appium tests are executed or even manual test cases are executed?
  Because then I can extract the exec file and send it so SonarQube for further analysis.</p>
  
  <p>Thanks
  Ben</p>