Android_adb详解

时间:2022-12-19 18:29:06

adb定义:
adb(android debug
bridge)是android系统中的一种命令行工具,通过它可以和android设备或模拟器通信。

adb工具位置:

<path-to-sdk>/tools/adb

adb源码位置:

<path-to-sourcecode>/system/core/adb

adb组成及实现原理:

adb本身是一个客户端服务器应用程序,由3个组件组成,Client, Server, Daemon,如下图
Android_adb详解

Android_adb详解

adb命令格式:
adb [-d|-e|-s
<serialNumber>]
<command>

adb命令分类:

Target device:-d/-e/-s
<serialNumber>

General:devices/help/version

Debug:logcat [option] [filter-specs]/bugreport/jdwp

Data:install <path-to-apk>/pull
<remote>
<local>/push
<local>
<remote>

Ports and Networking:forward
<local>
<remote>/ppp
<tty> [parm]...

Scripting:get-serialno/get-state/wait-for-device

Server:start-server/kill-server

Shell:shell/shell [shellCommand]