Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You have to make a test project with the android command line tools first. </p> <h3>Create Project &amp; Test Project</h3> <p>Assuming your project is stored in <code>D:\AndroidProject</code> and your programming against android API level 8. First you use this command to create the project:</p> <pre><code>android update project --path ./ --name blabla~ --target android-8 --subprojects </code></pre> <p>Then create an folder for the test project and navigate into that folder:</p> <pre><code>mkdir Android_test cd Android_test </code></pre> <p>Then create the android test project with the below command</p> <pre><code> android create test-project --main ../AndroidProject --path ./ </code></pre> <h3>Ant building with emma coverage report (with root)</h3> <p>Execute this command (from jenkins select and build step) to get a build done with emma reporting:</p> <pre><code>ant emma debug install test </code></pre> <p><strong>Caution</strong> : For this to work you have to connect rooted device or emulator, then execute ant command!</p> <h3>Change Build xml file (so no root is required)</h3> <p>If you don't want to root your device an alternative solution is to alter the location of these coverage reports. For this you should modify the build.xml file. </p> <p><em>(you should googling about that for more information, briefly explained here)</em></p> <p>Open the build.xml -> find the location where the <code>coverage.ec</code> file is stored. In most cases this will be stored in <code>/data/data/com.example.Android/coverage.ec</code></p> <p>The problem here is that the <code>/data/data/~~~</code> path is protected (hence the required root).</p> <p>anyway~ you can get a <code>coverage.html</code> file in your test project folder/bin. The next steps explain how to change this to save this file on the <code>/sdcard</code>instead!</p> <p>You can open your <code>build.xml</code> file and at the last line ~ you can find the command <code>import ~~~ build.xml</code> which means that your build.xml file will import anoother build.xml file. </p> <p>The other build.xml file is part of the android SDK and is located at <code>${Android-sdk}/tools/ant/build.xml</code>.</p> <h3>Required changes for build.xml file</h3> <p>We can't change this file (without getting into trouble) so instead copy the complete file to an alternative location or directly into your projects build.xml file. </p> <p><em>Don't forget to adapt or change the import statement in your build.xml file whatever you choose to do.</em></p> <p>This is what you need to change in that new build.xml file:</p> <ul> <li>Erase the <code>import= ~~build.xml</code></li> <li>Erase the first line which is <code>xml=ejkwjkw?e jw ""project = "android_rule"</code> ~~ ~blabla) </li> <li>and last line <code>/project</code></li> <li>update address to <code>/sdcard/coverage.ec</code></li> </ul> <p>Then, you can get coverage.ec file~</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload