Maven Android Plugin
http://www.cnblogs.com/santry/archive/2011/10/25/2223524.html

可用的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. 亲试,Windows平台上使用Qt5.2.1编写Android
  2. Android(安卓)-- adb devices找不到设备的解决办法
  3. Android(安卓)自定义字体
  4. Android样式——Styles
  5. 如何将library项目打包成jar文件
  6. sharedUserId 区别 process
  7. How to decompile .dex file on Android如何反编译.dex文件
  8. Android中字体加粗
  9. Android中蓝牙使用步骤小结

随机推荐

  1. Android自适应屏幕大小和layout布局
  2. Android世界:android 线程池
  3. Android ThreadLocal及InheritableThread
  4. Android(安卓)bound service 详解
  5. Android获取webView快照与屏幕截屏的方法
  6. android命令行下创建虚拟设备avd
  7. Android 资源简介(四) ClipDrawable
  8. Android(安卓)native 内存泄露检测
  9. Android进程与线程的概念
  10. android 控件的隐藏和显示