创建与Maven AVD默认? [英] Create a default AVD with maven?

查看:133
本文介绍了创建与Maven AVD默认?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是有可能创建与Maven的Andr​​oid虚拟设备?因为现在人们必须运行Maven构建与仪器测试之前手动创建AVD。

is it possible to create an Android Virtual Device with Maven? Because right now one has to create an AVD manually before running the maven build with instrumentation tests.

在网上搜索,但能找到的任何信息。 href=\"http://maven-android-plugin-m2site.google$c$c.com/svn/plugin-info.html\" rel=\"nofollow\"> Android的Maven的插件 ISN的

I searched the web, but could find any information. The android-maven-plugin isn't able to do it.

推荐答案

<一个href=\"http://stackoverflow.com/questions/17979661/create-a-default-avd-with-maven#comment26292925_17979661\">Thanks到yorkw ,我找到了解决办法。

Thanks to yorkw, I found a solution.

请注意:


  • Ant任务仅适用于Windows,但可以轻松地调整用于其他操作系统。

  • 选择的目标的Andr​​oid是非常重要的,因为有些指标需要用户交互来创建一个AVD:

从命令行管理自动真空淀积系统:如果你选择的目标
  是一个标准的Andr​​oid系统映像(类型:平台),在android
  在下工具会询问您是否要创建一个自定义硬件
  配置文件。

Managing AVDs from the Command Line: "If the target you selected was a standard Android system image ("Type: platform"), the android tool next asks you whether you want to create a custom hardware profile."

的pom.xml

        <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <configuration>
                <tasks>
                    <exec executable="cmd.exe">
                        <arg value='/c ${env.ANDROID_HOME}\tools\android create avd --name myDefaultAVD --target "Google Inc.:Google APIs:10" --force'/>
                    </exec>
                </tasks>
            </configuration>
            <executions>
                <execution>
                    <id>createDefaultAVD</id>
                    <phase>generate-test-resources</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

这篇关于创建与Maven AVD默认?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆