现在的位置: 首页 > 综合 > 正文

Android常用命令

2013年08月11日 ⁄ 综合 ⁄ 共 1623字 ⁄ 字号 评论关闭

1. ant命令

1) ant clean : 清除项目的生成文件

2) ant debug: 生成一个debug apk,并使用debug key进行签名

3) ant emma debug: 生成一个测试项目

4) ant release: 生成一个release apk,并不进行签名和对齐

5) ant debug install: 生成并安装一个apk包

6) ant installd: 安装一个已经编译好的debug包

7) ant installr: 安装一个已经编译好的release包

8) ant installt: 安装一个已经编译好的测试包

9) ant installi: 安装一个已经编译好的instrumented包

 

2. Android Debug Bridge (adb)

    Adb是一个用于与Android设备或模拟器进行通信的命令行工具,它是C-S模式,adb server运行于Android设备,而adb client运行于开发机器上,ADT Plugin和DDMS也建立adb客户端。

1) adb devices: 查看已连接的设备

2) adb install <path_to_apk>:安装指定的apk文件

3) adb push
<local> <remote>:copy一个文件或目录(递归)到模拟器或设备

4)
adb pull
<remote> <local>:从模拟器或设备copy一个文件或目录(递归)到本地

5) adb help: 获得帮助信息

6) adb start-server: 在设备上check adb server是否已经启动

7) kill-server:在设备上终止adb server进程

8) adb shell: 启动设备上的shell

9) adb connect <host>[:<port>]: 通过TCP/IP建立连接,默认port为5555,如adb connect 192.168.6.161

10) adb disconnect [<host>[:<port>]]:断掉指定IP的连接,adb disconnect则断掉所有通过TCP/IP连接的设备

 

3. android

    android功能如下:

    • 创建、删除和查看AVD(Android  Virtual Devices)

    • 创建和更新Android projects

    • 更新Android SDK新平台、插件和文档

1) android -h: 查看帮助信息

2) android sdk: 启动Android SDK Manager

3) android avd: 启动AVD manager

4) android create project: 建立新的项目,参数如下:

-n <name> The name for the project Required
-t <targetID> Target ID of the system image to use with the new AVD. To obtain a list of available targets, use
android list targets
Required
-k <path>|<size>[K|M] Package namespace Required
-a Name for the default Activity class Required
-p <path> Location of your project directory Required

5) anddroid update project: 更新已经存在的项目,参数如下:

-n <name> The name of the project to update  
-p <path> Location path of the project Required
-l <library path> Location path of an Android Library to add, relative to the main project  
-s <subprojects> Update any projects in subfolders such as test projects

6) android update adb: 更新adb

 

 

 

 

 

 

 

 

抱歉!评论已关闭.