Follow the steps in this link to automatically generate Ant's Build.xml files for an existing Robotium project: http://xiaomaozi.blog.51cto.com/925779/932284/
Follow the steps in this link to import android-junit-report.jar items and manipulate them according to the links: http://www.xuebuyuan.com/2148574.html
Http://www.tuicool.com/articles/Rzayie
Add the following code to the Build.xml file:
< target name="Fetch-test-report">
< XPath input="${tested.project.dir}/ Androidmanifest.xml "
expression="/manifest/instrumentation/@android: Targetpackage" OUTPU T="Tested.package"/>
< Echo > Downloading XML test Report ... </ Echo >
< Span style= "COLOR: #4e9192" >mkdir dir = "${reports.dir}" />
< Span style= "COLOR: #4e9192" >exec executable = "${adb}" failonerror= "True" >
< arg line="${adb.device.arg}"/>
< Arg Value="Pull" />
< arg value="/data/data/${tested.package}/files/junit-r Eport.xml "/>
< arg value="${reports.dir}/junit-report.xml" />
</ exec >
</target>
"/manifest/instrumentation/@android: Targetpackage" It is important to note that the package that should point to the instrumentation in Androidmanifest.xml in the test project will be an error.
<instrumentation
android:name="Com.zutubi.android.junitreport.JUnitReportTestRunner"
android:targetpackage="com.example.example"/>
and add it to the Ant.property.
test.runner=Com.zutubi.android.junitreport.JUnitReportTestRunner
Robotium+ant+android-junit-report