为什么android单元测试没有用mvn test命令执行 mvn测试 它说没有测试用例,虽然有Android单元测试。 你能告诉一个方法如何使用mvn test
运行这些测试当我们进入android mvn test
时如何运行mvn android:instrument<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample.projectfoundation</groupId>
<artifactId>androidsdktest</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>AndroidSDKTest</name>
<dependencies>
<dependency>
<groupId>com.sample.projectfoundation</groupId>
<artifactId>androidsdk</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>2.2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-test</artifactId>
<version>2.3.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src</sourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.3</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<!-- platform or api level (api level 4 = platform 1.6) -->
<platform>19</platform>
</sdk>
<emulator>
<avd>mydevice</avd>
<!-- Wait for emulator starting (3 minutes) -->
<wait>180000</wait>
<options>-no-skin</options>
</emulator>
</configuration>
</plugin>
</plugins>
</build>
</project>