您的位置:首页 > 其它

根据官方文档解析adb命令的详细操作

2015-11-19 21:04 483 查看

根据官方文档翻译android 的adb操作命令

一、ADB是什么

Android调试桥(adb)是一个通用的命令行工具,它可以让你与一个模拟器实例或连接的Android设备交互。它是一个客户机-服务器程序。ADB工具一般由以下几部分组成。

A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients

A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device.

A daemon, which runs as a background process on each emulator or device instance.

ADB工具一般在哪里。

You can find the adb tool in /platform-tools/.

二、ADB命令使用语法?

adb 例如:adb devices 查看所有连接的设备。

三、ADB命令具体使用步骤和截图

1.查看所有连接设备的列表。

adb devices



2.如果模拟器和真机同时连接的时候,需要指定那个设备去执行命令。

adb -s <设备序列号> <命令> 例如:adb -s 0123456789ABCDEF install One.apk



3.查看ADB帮助命令

adb help

4.查看ADB版本号

adb version

5、获取设备的ID和序列号

adb get-serialno

6、安装应用的命令

adb install One.apk



7、缷载apk的命令

adb uninstall apk包的包名



8、获取管理员权限

adb root

9、重新挂载系统分区,使系统分区只读变可写

adb remount

10、从本地向设备中push文件

adb push <本地文件> <设备需要push的路径> 例如:adb push One.apk /data/app



11、从设备向本地拉文件

adb pull <设备中的文件> <本地路径> 例如:adb pull /data/app/One.apk D:\



12、进入android设备的shell模式

adb shell

13、删除系统应用

adb remount
adb shell
cd system/app
rm *.apk


14、启动adb服务进程

start-server

15、杀死adb服务进程

kill-server

16、抓取指定tag的log信息

1、adb shell

2、logcat |grep tag 例如:adb logcat |grep xyz



17、你可以设置任意的端口号,做为主机向模拟器或设备的请求端口

adb forward tcp:5555 tcp:8000

18、重新启动设备

adb reboot

四、adb命令还有很多,上述都是比较常用的一些命令,可以根据adb help查看更多命令的用法,请关注下一篇logcat的具体使用。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: