创建命令提示符apk文件命令提示符、文件、apk

2023-09-05 08:25:48 作者:〓俄只是太想妳

我想创建从命令提示符下的.apk文件。为了这个,我按照此链接

i want to create .apk file from command prompt. for this i follow this link

,并尝试以完成它ant..but它给我的错误。

and try to complete it with ant..but it is giving me error.

的taskdef类   com.android.ant.setuptask不能   发现

taskdef class com.android.ant.setuptask cannot be found

任何一个可以请帮我什么错误,我现在做的还是给我提供一步步的教程这一点。

can any one please help me what mistake i am doing or provide me a step by step tutorial for this.

在此先感谢...

推荐答案

您需要传递sdk.dir成蚁,即蚂蚁-Dsdk.dir =<路径的Andr​​oid SDK>

You need to pass sdk.dir into ant, i.e. ant -Dsdk.dir=<path to Android SDK>

你还需要指定的七,因此Android构建目标之一,因为默认的构建目标是帮助。

You'll also need to specify one of the seven or so Android build targets because the default build target is 'help'.

如果你只是执行蚂蚁-Dsdk.dir =&LT;路径的Andr​​oid SDK&GT; ,你会得到一些帮助输出,就像这样:

If you just run ant -Dsdk.dir=<path to Android SDK>, you'll get some help output, like so:

help:
 [echo] Android Ant Build. Available targets:
 [echo]    help:      Displays this help.
 [echo]    clean:     Removes output files created by other targets.
 [echo]    compile:   Compiles project's .java files into .class files.
 [echo]    debug:     Builds the application and signs it with a debug key.
 [echo]    release:   Builds the application. The generated apk file must be

 [echo]               signed before it is published.
 [echo]    install:   Installs/reinstalls the debug package onto a running
 [echo]               emulator or device.
 [echo]               If the application was previously installed, the
 [echo]               signatures must match.
 [echo]    uninstall: Uninstalls the application from a running emulator or
 [echo]               device.

BUILD SUCCESSFUL
Total time: 7 seconds 

要构建APK,你必须指定调试发布

To build the APK, you have to specify debug or release.

蚂蚁-Dsdk.dir =&LT;路径的Andr​​oid SDK&GT;调试