可用的Goals

Goal 描述
android:apk 创建apk文件。默认使用debug密钥对Apk签名。
如需修改可以修改配置参数为<sign><debug>false</debug></sign>
android:apklib 创建apklib文件。apklib文件并不会被部署。
android:deploy 部署编译好或指定的apk文件到一个连接的设备上。在运行mvn integration-test(或mvn install)命令会自动执行。
android:deploy-dependencies Deploys all directly declared dependencies of <type>apk</type> in this project's pom.Usually used in a project with instrumentation tests, to deploy the apk to test onto the device before running the deploying and running the instrumentation tests apk.Automatically performed when running mvn integration-test (or mvn install) on a project with instrumentation tests.
android:dex 将编译好的Java classes转换为Android dex格式。
android:emulator-start 启动指定的Android模拟器。
android:emulator-stop 停止指定的Android模拟器.
android:generate-sources Generates R.java based on resources specified by the resources configuration parameter.Generates java files based on aidl files.
If the configuration parameter deleteConflictingFiles is true (which it is by default), this goal has the following side-effects:
deletes any R.java files found in the source directory.
deletes any .java files with the same name as an .aidl file found in the source directory.
deletes any Thumbs.db files found in the resource directory.
android:instrument 在设备运行apk程序.
android:internal-integration-test 内部命令,不要直接使用。生命周期到达integration-test步骤时会自动调用。
android:ndk-build 未知
android:pull 从设备上复制文件/文件夹。
android:push 拷贝文件/文件夹到设备上。
android:redeploy 在连接的设备上重新部署编译或指定的apk文件。
android:undeploy 从连接的设备上卸载生成或指定的apk文件。
android:unpack 解包库。
android:version-update 更新AndroidManifest.xml文件中版本信息相关内容。可以使android:versionName属性值和工程的版本信息保持一致。也可以配置使android:versionCode自动增长。
注意:该操作可能会重新格式化AndroidManifest.xml文件内容。

配置自动更新android:versionName:
  <plugin>    <groupId>com.jayway.maven.plugins.android.generation2</groupId>    <artifactId>maven-android-plugin</artifactId>    <executions>      <execution>        <id>update-version</id>        <goals>          <goal>version-update</goal>        </goals>        <configuration>          <versionNameUpdate>true</versionNameUpdate>        </configuration>      </execution>    </executions>  </plugin>

配置android:versionCode自动增长:

  <plugin>    <groupId>com.jayway.maven.plugins.android.generation2</groupId>    <artifactId>maven-android-plugin</artifactId>    <executions>      <execution>        <id>update-version</id>        <goals>          <goal>version-update</goal>        </goals>        <configuration>          <versionCodeAutoIncrement>true</versionCodeAutoIncrement>        </configuration>      </execution>    </executions>  </plugin>
android:zipalign ZipalignMojo can run the zipalign command against the apk.

更多相关文章

  1. android attr.xml文件
  2. 【Android 系统开发】 编译 Android文件系统 u-boot 内核 并烧写
  3. 如何向Android模拟器打电话发短信
  4. android的布局文件简介
  5. 【Android】Android 代码判断当前设备是否为模拟器
  6. Android 数据存储之文件存储小记
  7. 使用Javascript判断浏览器终端设备(PC、IOS(iphone)、Android)
  8. Android软件安装文件夹
  9. 详细解读Android中的搜索框(四)—— Searchable配置文件

随机推荐

  1. Android自带的主题与样式
  2. xml属性
  3. Android技能树 — Rxjava取消订阅小结(2)
  4. android api 和版本对应表汇总
  5. Android的Layout及其Param
  6. Android技能树 — Rxjava取消订阅小结(1)
  7. android .xml文件 布局文件
  8. Android的Layout及其Param
  9. Android的Layout及其Param
  10. Android之阴影制作(Shadow)