今天把安装的android开发环境打开。弄了测试项目,但没发现build.xml。找了下资料。弄了下,过程如下:



输入:android.bat list target 来查询我们现有的版本list有哪些.



记住这个ID号码,下的代码面会用到.
输入:android update project -n ButtonDemo -t 1 -p E:workspacendroidButtonDemo

-n对应的是项目名称
-t就是我们之前查询的SDK版本对应的ID,大家根据自己的项目版本做出选择即可,我这个是android-8 所以用ID 1 .
-p就是生成的路径
成功后显示:

好了以下是生成的build.xml代码段:

<?xml version="1.0" encoding="UTF-8"?>
<project name="ZpTest" default="help">

<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />

<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:来源 www.pms.cc

source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.

For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml

Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.

This file is an integral part of the build system for your
application and should be checked into Version Control Systems.

-->
<property file="ant.properties" />

<!-- if sdk.dir was not set from one of the property file, then
get it from the ANDROID_HOME env var.
This must be done before we load project.properties since
the proguard config can use sdk.dir -->
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>

<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.

This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).

This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />

<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>

<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}来源 www.pms.cc
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />

<!-- Import the actual build file.

To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.

***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />

</project>

本文转载自:http://www.pms.cc/android/dev/201308/Android_build_xml.html

更多相关文章

  1. android jni开发,用javah生成***.h头文件,用ndk在libs下生成***.so
  2. 开源项目之Android(安卓)GreenDroid(界面库)
  3. 使用x5cloud云平台来做网络彩讯-------------手机系统版本问题(九
  4. eclipse build 不生成apk的办法
  5. Android(安卓)JNI(JNI(JAVA同C++配合使用)
  6. 关于解决Android(安卓)Studio:Connection timed out: connect
  7. Android(安卓)- 比较版本号大小、安装apk、获取设备唯一标识、获
  8. Ubuntu 11.10编译Android(安卓)错误
  9. Android(安卓)推送之Androidpn项目分析(一)

随机推荐

  1. Android Studio中图片的格式转换
  2. 基于xmpp openfire smack开发之Android消
  3. Android Studio中src/main/res/values中s
  4. Android开发中的Handler线程初窥,及Handle
  5. android APP 获得system权限
  6. Android的Touch事件处理和手势
  7. android 权限定义的文件,位置
  8. Debian 5 Android 编译
  9. android后台执行定时任务(保活)&&使用Alarm
  10. 【20151202】每日学习总结