如何创建的build.xml为Android项目? [英] How to create build.xml for an Android project?

查看:164
本文介绍了如何创建的build.xml为Android项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图运行,我直接从源$ C ​​$ C下载的书开始的Andr​​oid 4.0获得简单的程序。不过,我有很多问题中的build.xml文件(见previous的问题,这是没有答案)。我的最新的是,这是从一个简单的标签演示程序:

I've been trying to run simple programs that I obtained directly from the Source Code download for the book 'Beginning Android 4'. However, I have lots of problems with the build.xml files (see previous questions, which are unanswered). My latest is, which comes from the a simple Label demo program:

# ant debug
Buildfile: /home/me/src/ANDROID/MyProjects/Label/build.xml

BUILD FAILED
Target "debug" does not exist in the project "LabelDemo". 

我那么检查与其他工作的build.xml文件,并作为fasr我所知道的,grepping直通该文件的文本,调试也不存在。但他们的工作。

I then checked with other working build.xml files and as fasr as I can tell, grepping thru the text of the file, 'debug' doesn't exist there either. But they work.

所以,我显然必须是正确创建的build.xml文件。什么是创建构建文件的Andr​​oid项目(在命令行)的正确方法。

So, I obviously must be creating build.xml files incorrectly. What is the correct way to create the build file for an Android project (from the command-line).

推荐答案

运行 Android的更新项目-p ... ,其中 ... 是路径到项目中。这将创建或更新的build.xml 和相关的命令行构建文件。这里假设你的SDK的路径工具/ 目录;否则,你将需要完全限定路径 机器人 命令。

Run android update project -p ..., where the ... is the path to the project. This will create or update the build.xml and related command-line build files. This assumes that your SDK's tools/ directory in your PATH; otherwise, you will need to fully-qualify the path to the android command.

这篇关于如何创建的build.xml为Android项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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