http://developer.android.com/tools/projects/projects-cmdline.html
1.首先是为项目生成build.xml文件
执行命令android update project --name projectName -t 3 -pprojectPath
效果如下图
http://developer.android.com/tools/projects/projects-cmdline.html
localhost:android_wardrobe wuyexiong$ android update project --name wardrobe --target 23 --path /Users/wuyexiong/company/android_wardrobe/wardrobe
Updated project.properties
Updated local.properties
Updated file /Users/wuyexiong/company/android_wardrobe/wardrobe/build.xml
It seems that there are sub-projects. If you want to update them
please use the --subprojects parameter.
localhost:android_wardrobe wuyexiong$ android update project --target 23 --path /Users/wuyexiong/company/android_wardrobe/wardrobe/ --library /Users/wuyexiong/company/android_wardrobe/wardrobe_pulltorefresh/
Resolved location of library project to: /Users/wuyexiong/company/android_wardrobe/wardrobe_pulltorefresh
Updated project.properties
Updated local.properties
It seems that there are sub-projects. If you want to update them
please use the --subprojects parameter.
在项目目录下运行ant,得出如下提示
help:
[echo] Android Ant Build. Available targets:
[echo] help: Displays this help.
[echo] clean: Removes output files created by other targets.
[echo] The 'all' target can be used to clean dependencies
[echo] (tested projects and libraries)at the same time
[echo] using: 'ant all clean'
[echo] debug: Builds the application and signs it with a debug key.
[echo] The 'nodeps' target can be used to only build the
[echo] current project and ignore the libraries using:
[echo] 'ant nodeps debug'
[echo] release: Builds the application. The generated apk file must be
[echo] signed before it is published.
[echo] The 'nodeps' target can be used to only build the
[echo] current project and ignore the libraries using:
[echo] 'ant nodeps release'
[echo] instrument:Builds an instrumented package and signs it with a
[echo] debug key.
[echo] test: Runs the tests. Project must be a test project and
[echo] must have been built. Typical usage would be:
[echo] ant [emma] debug install test
[echo] emma: Transiently enables code coverage for subsequent
[echo] targets.
[echo] install: Installs the newly build package. Must either be used
[echo] in conjunction with a build target (debug/release/
[echo] instrument) or with the proper suffix indicating
[echo] which package to install (see below).
[echo] If the application was previously installed, the
[echo] application is reinstalled if the signature matches.
[echo] installd: Installs (only) the debug package.
[echo] installr: Installs (only) the release package.
[echo] installi: Installs (only) the instrumented package.
[echo] installt: Installs (only) the test and tested packages (unless
[echo] nodeps is used as well.
[echo] uninstall: Uninstalls the application from a running emulator or
[echo] device. Also uninstall tested package if applicable
[echo] unless 'nodeps' is used as well.
localhost:wardrobe wuyexiong$ ant uninstall
Buildfile: /Users/wuyexiong/company/android_wardrobe/wardrobe/build.xml
-check-env:
[checkenv] Android SDK Tools Revision 21
[checkenv] Installed at /Users/wuyexiong/Documents/Dev/Android/android-sdk-macosx
-setup:
[echo] Project Name: wardrobe
[gettype] Project Type: Application
uninstall:
[echo] Uninstalling com.haobao.wardrobe from the default emulator or device...
[exec] Success
BUILD SUCCESSFUL
Total time: 2 seconds
localhost:wardrobe wuyexiong$ ant debug install
Buildfile: /Users/wuyexiong/company/android_wardrobe/wardrobe/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 21
[checkenv] Installed at /Users/wuyexiong/Documents/Dev/Android/android-sdk-macosx
-setup:
[echo] Project Name: wardrobe
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-build-setup:
[echo] Resolving Build Target for wardrobe...
[gettarget] Project Target: Android 4.1.2
[gettarget] API level: 16
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for wardrobe...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[echo] ----------
[echo] Building Libraries with 'debug'...
nodeps:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 21
[checkenv] Installed at /Users/wuyexiong/Documents/Dev/Android/android-sdk-macosx
-setup:
[echo] Project Name: wardrobe_pulltorefresh
[gettype] Project Type: Android Library
-set-debug-mode:
-debug-obfuscation-check:
-build-setup:
[echo] Resolving Build Target for wardrobe_pulltorefresh...
[gettarget] Project Target: Android 4.1.2
[gettarget] API level: 16
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for wardrobe_pulltorefresh...
[dependency] Library dependencies:
[dependency] No Libraries
-pre-build:
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] No changed resources. R.java and Manifest.java untouched.
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
[echo] Creating library output jar file...
-post-compile:
-obfuscate:
-dex:
[echo] Library project: do not convert bytecode...
-crunch:
[crunch] Crunching PNG Files in source dir: /Users/wuyexiong/company/android_wardrobe/wardrobe_pulltorefresh/res
[crunch] To destination dir: /Users/wuyexiong/company/android_wardrobe/wardrobe_pulltorefresh/bin/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[echo] Library project: do not package resources...
-package:
[echo] Library project: do not package apk...
-post-package:
-do-debug:
[echo] Library project: do not create apk...
[propertyfile] Updating property file: /Users/wuyexiong/company/android_wardrobe/wardrobe_pulltorefresh/bin/build.prop
[propertyfile] Updating property file: /Users/wuyexiong/company/android_wardrobe/wardrobe_pulltorefresh/bin/build.prop
[propertyfile] Updating property file: /Users/wuyexiong/company/android_wardrobe/wardrobe_pulltorefresh/bin/build.prop
[propertyfile] Updating property file: /Users/wuyexiong/company/android_wardrobe/wardrobe_pulltorefresh/bin/build.prop
-post-build:
debug:
-pre-build:
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] No changed resources. R.java and Manifest.java untouched.
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.
-pre-compile:
-compile:
-post-compile:
-obfuscate:
-dex:
[dex] input: /Users/wuyexiong/company/android_wardrobe/wardrobe/bin/classes
[dex] input: /Users/wuyexiong/company/android_wardrobe/wardrobe_pulltorefresh/bin/classes.jar
[dex] input: /Users/wuyexiong/company/android_wardrobe/wardrobe/libs/gson-2.2.2.jar
[dex] input: /Users/wuyexiong/company/android_wardrobe/wardrobe/libs/umeng_sdk.jar
[dex] input: /Users/wuyexiong/company/android_wardrobe/wardrobe/libs/android-support-v4.jar
[dex] Using Pre-Dexed classes-a1f893dd4075b58ecd2f0da685f2ab7a.jar <- /Users/wuyexiong/company/android_wardrobe/wardrobe_pulltorefresh/bin/classes.jar
[dex] Using Pre-Dexed gson-2.2.2-de6fbe71bf7663e94351648f04d14d3e.jar <- /Users/wuyexiong/company/android_wardrobe/wardrobe/libs/gson-2.2.2.jar
[dex] Using Pre-Dexed umeng_sdk-bfaefaa81d40319afd9177a431101238.jar <- /Users/wuyexiong/company/android_wardrobe/wardrobe/libs/umeng_sdk.jar
[dex] Using Pre-Dexed android-support-v4-48870b25fa653c73e5a248db2a3e5e6f.jar <- /Users/wuyexiong/company/android_wardrobe/wardrobe/libs/android-support-v4.jar
[dex] No new compiled code. No need to convert bytecode to dalvik format.
-crunch:
[crunch] Crunching PNG Files in source dir: /Users/wuyexiong/company/android_wardrobe/wardrobe/res
[crunch] To destination dir: /Users/wuyexiong/company/android_wardrobe/wardrobe/bin/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[aapt] No changed resources or assets. wardrobe.ap_ remains untouched
-package:
[apkbuilder] No changes. No need to create apk.
-post-package:
-do-debug:
[zipalign] Run cancelled: no changes to input file /Users/wuyexiong/company/android_wardrobe/wardrobe/bin/wardrobe-debug-unaligned.apk
[echo] Debug Package: /Users/wuyexiong/company/android_wardrobe/wardrobe/bin/wardrobe-debug.apk
[propertyfile] Updating property file: /Users/wuyexiong/company/android_wardrobe/wardrobe/bin/build.prop
[propertyfile] Updating property file: /Users/wuyexiong/company/android_wardrobe/wardrobe/bin/build.prop
[propertyfile] Updating property file: /Users/wuyexiong/company/android_wardrobe/wardrobe/bin/build.prop
[propertyfile] Updating property file: /Users/wuyexiong/company/android_wardrobe/wardrobe/bin/build.prop
-post-build:
debug:
install:
[echo] Installing /Users/wuyexiong/company/android_wardrobe/wardrobe/bin/wardrobe-debug.apk onto default emulator or device...
[exec] 4441 KB/s (869375 bytes in 0.191s)
[exec] pkg: /data/local/tmp/wardrobe-debug.apk
[exec] Success
BUILD SUCCESSFUL
ubuntu12.10下编译会出错。
BUILD FAILED
/home/wuyexiong/company/android_wardrobe/wardrobe/build.xml:90: The following error occurred while executing this line:
/home/wuyexiong/Android/android-linux/adt-bundle-linux-x86_64/sdk/tools/ant/build.xml:206: No supported regular expression matcher found: java.lang.ClassNotFoundException: org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp
Total time: 0 seconds
wuyexiong@wuyexiong-System-Product-Name:~/company/android_wardrobe/wardrobe$
sudo apt-get install ant-optional
安装一个最新的ant 搞定
分享到:
相关推荐
OS X Mountain Lion 10.8.2 VMware Image VMware 镜像 AMD Interl CPU 都可用,AMD已测试,镜像可直接打开,无需引导
Moutain Lion 10.8.2 10.7.5 懒人版,实测有效
苹果最新推出ml10.8.2,用迅雷下载资源多速度快。
mac 10.8.2 懒人版
本人是Dell E6400,安装的是 10.8.2懒人版,除无线网卡外,其他完美驱动。 把所有和这个里面有冲突的驱动都删掉,然后粘贴过去,不要直接覆盖。 安装教程参考:http://benyouhui.it168.com/thread-2867663-1-1.html
dfcf_silence_upgrade_cfw_10.8.2_20230625160622_32.apk
WIN7下VMware9.0.1虚拟机安装MacOSX10.8.2Lion教程
mac系统 10.8.2 这里给出种子,给需要的童鞋
韩国naver应用apk安装包 韩国naver应用apk安装包 韩国naver应用apk安装包 韩国naver应用apk安装包 韩国naver应用apk安装包
在MAC10.8.2下 完美驱动usb3.0的DSDT.aml 文件,完美驱动, 显卡Nvdia, 声卡ALC, 板载网卡等,推荐华硕主板下载,安装黑苹果的必须文件
编译实在太麻烦了,环境是 MacOs 10.8.2,php5.3.15,下载后放在适当的目录后配置下php.ini即可
karen lion mac 10.8.2
atom 10.8.2 mac 破解内核
mac10.8.2OSInstall(MBR) OSInstall.mpkg
mac10.8.2OS Nv9系显卡驱动
10.8.2 RTL81xx网卡驱动 Kext
AMD的mountain lion 10.8.2内核amd_kernel.zip
Portrait Professional v10.8.2破解版下载
windows10官方允许的修改软件
10.8.2 amd内核