命令行下创建 Android 工程,用 Ant 进行编译部署
来源:互联网 发布:从零开始学日语软件 编辑:程序博客网 时间:2024/06/05 12:02
如果你没有使用IDE(例:Eclipse ADT、Android Studio),而是stand-alone SDK tools那么你需要使用命令行来构建android project,并且用ant或者gradle来build你的project。
环节一:开发环境搭建
下载stand-alone SDK tools。下载地址,安装好后,cmd进入tools\,运行android.bat来启动sdk manager下载sdk 以及Android sdk tools和build tools。
再下载ant构建工具,下载地址,接下后,浆ant所在目录配置到系统路径里,便于在cmd中使用。
环节二:开发应用程序
Create a Project with Command Line Tools
If you're not using the Eclipse IDE with the ADT plugin, you can instead create your project using the SDK tools from a command line:
- Change directories into the Android SDK’s
tools/
path. - Execute:
android list targets
This prints a list of the available Android platforms that you’ve downloaded for your SDK. Find the platform against which you want to compile your app. Make a note of the target id. We recommend that you select the highest version possible. You can still build your app to support older versions, but setting the build target to the latest version allows you to optimize your app for the latest devices.
If you don't see any targets listed, you need to install some using the Android SDK Manager tool.
- Execute:
android create project --target <target-id> --name MyFirstApp \--path <path-to-workspace>/MyFirstApp --activity MainActivity \--package com.example.myfirstapp
Replace
<target-id>
with an id from the list of targets (from the previous step) and replace<path-to-workspace>
with the location in which you want to save your Android projects.
Your Android project is now a basic "Hello World" app that contains some default files. To run the app, continue to the next lesson.
Tip: Add the platform-tools/
as well as the tools/
directory to your PATH
environment variable.
Running Your App
run your app from a command line:
- Change directories to the root of your Android project and execute:
ant debug
- Make sure the Android SDK
platform-tools/
directory is included in yourPATH
environment variable, then execute:adb install bin/MyFirstApp-debug.apk
- On your device, locate MyFirstActivity and open it.
- 命令行下创建 Android 工程,用 Ant 进行编译部署
- 命令行下创建 Android 工程,用 Ant 进行编译部署
- 命令行下创建 Android 工程,用 Ant 进行编译部署
- 命令行下创建Android工程,用Ant部署编译
- [转]命令行下创建 Android 工程,用 Ant 进行编译部署
- ant: 创建编译 android 工程
- ant: 创建编译 android 工程
- 使用 ANT 命令行编译 Android 工程
- Ant 命令行创建一个Android工程
- 命令行下的android工程的创建、编译与打包
- Window下ant编译android工程
- ant编译Android工程
- ant 编译android工程
- ant 编译android工程
- ant 编译android工程
- ant 编译android工程
- ant 编译 android工程
- Android ANT工程创建
- 使用cocos2dx-LuaProxy便捷Lua项目快速使用cocos2dx引擎extensions扩展包
- 利用Lua强转函数解决使用CCNode报错或无法正常使用以及简单介绍 quick-cocos2d-x 与 OpenQuick 两款Lua免费开源框架
- Lua 使用OOP(面对对象思想编程),免Binding创建自定义lua类
- Android系列--DOM、SAX、Pull解析XML
- 使用tolua++编译pkg,从而创建自定义类让Lua脚本使用
- 命令行下创建 Android 工程,用 Ant 进行编译部署
- 类型转换
- C++ time(NULL) 计算持续的时间长度
- 如何优化cocos2d/x程序的内存使用和程序大小
- 线程的同步机制
- TC srm 632 div1
- 彻底搞清楚C/C++中日期和时间 time_t与struct tm,time(NULL),ctime;strftime
- 剑指Offer调整顺序使奇数位于偶数前面
- 05_从尾到头打印链表