Android Debug Bridge

Android Debug Bridge

  ADB lets you communicate with an emulator instance or connected Android-powered device. ADB is a client-server program that includes three components:

  • 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.

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

  When you start an adb client, the client first checks whether there is an adb server process already running. If there isn‘t, it starts the server process. When the server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb clients use port 5037 to communicate with the adb server.

  adb-server使用5037作为接口,接收所有client的请求。

  The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port. Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example:

  Emulator 1, console: 5554
  Emulator 1, adb: 5555
  Emulator 2, console: 5556
  Emulator 2, adb: 5557
  and so on...

  偶数用于console连接,奇数用于adb连接

  As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554.

  Once the server has set up connections to all emulator instances, you can use adb commands to access those instances. Because the server manages connections to emulator/device instances and handles commands from multiple adb clients, you can control any emulator/device instance from any client (or from a script).

Enabling adb Debugging

  In order to use adb with a device connected over USB, you must enable USB debugging in the device system settings, under Developer options.

命令定向

  

  

  -s 的参数使用devices命令来获得。

Querying for Emulator/Device Instances

  输入 adb devices后,In response, adb prints this status information for each instance:

  • Serial number — A string created by adb to uniquely identify an emulator/device instance by its console port number. The format of the serial number is <type>-<consolePort>. Here‘s an example serial number: emulator-5554
  • State — The connection state of the instance may be one of the following:
    • offline — the instance is not connected to adb or is not responding.
    • device — the instance is now connected to the adb server. Note that this state does not imply that the Android system is fully booted and operational, since the instance connects to adb while the system is still booting. However, after boot-up, this is the normal operational state of an emulator/device instance.
    • no device — there is no emulator/device connected.

  Here‘s an example showing the devices command and its output:

  

Installing an Application

  

参考:http://developer.android.com/tools/help/adb.html

时间: 2025-01-02 13:28:28

Android Debug Bridge的相关文章

VS2015 Could not locate the Android Debug Bridge (adb.exe).

VS2015 corvoda出现"Could not locate the Android Debug Bridge (adb.exe)." 是由于找不到adb.exe引起,Android sdk环境变量的问题 VS中Android sdk是在注册表中指定的,位置HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools  键-Path 修改Path值为Android sdk路径,问题解决 注意:sdk路径下要有  \platfo

C语言基础课程 第三课 ADB(Android Debug Bridge)的使用

?? C语言基础课程 第三课 ADB(Android Debug Bridge)的使用 由于前面已经发布过Linux的博客了 基础班将Linux基础命令就不单独发表博客了,本节课主要就是利用adb连接手机进行一个Linux基本命令的复习.而且熟悉手机的底层运作,不用界面操作照样也能安装软件  卸载软件与pc传数据 目  录 1       将android设备通过USB连接到PC. 3 2       查看当前设备... 3 3       进入设备shell. 4 4       执行shel

Android之独孤口诀:模拟器创建及adb(android debug bridge安卓调试桥)

VGA:640*480 像素 HVGA(half vga):480*320 像素 QVGA(quarter vga):320*240 像素 WVGA(width vga):800*480 像素 FWVGA:854*480 二.adb(android debug bridge:安卓调试桥) 常用命令: pull: adb pull  /storage/sdcard1/DCIM/Camera/IMG_20141124_193236.jpg  abc.jpg  (将 /storage/sdcard1/

ADB(Android Debug Bridge)小结

@echo offtitle Android Debug Bridge ECHO 关闭ADBadb kill-server ECHO 启动ADBadb start-server ECHO 查看已连接 adb 的设备列表adb devices ECHO 远程调试adb connect 192.168.43.1 ECHO 获取权限adb root ECHO 获取设备的状态adb get-state ECHO 打印 Android 的系统日志adb logcat ECHO 手机屏幕保存到SDCarda

Android Debug Bridge version 1.0.41

Android Debug Bridge version 1.0.41 Version 29.0.1-5644136 Installed as D:\Program Files\Android\platform-tools\adb.exe global options: -a listen on all network interfaces, not just localhost -d use USB device (error if multiple devices connected) -e

Android 官方命令之Android Debug Bridge(adb)(未完待续)

作者:宋志辉 Android Debug Brideg(adb)是一个多用途的命令行工具.可以与Android虚拟机进行通信或连接真机.它同样提供了访问设备shell的高级命令行操作的权限.它是一个包含以下三部分的客户端-服务端程序: 一个客户端,运行在你的开发设备上.你可以通过adb命令来从shell中调用一个客户端.或者通过ADT插件和DDMS创建adb客户端. 一个服务端,作为一个后台进程运行在你的开发设备中.服务端负责客户端和虚拟机或设备中adb守护进程的通信. 一个守护进程,运行在虚拟

ADB常用命令(Android Debug Bridge)

首先要配置环境变量. adb devices 列出所有的设备 adb start-server 开启adb服务 adb kill-server    关闭adb服务 adb logcat    查看Log adb shell    挂载到Linux的空间 adb install <应用程序(加扩展名)>     安装应用程序 adb –s <模拟器名称>  install  <应用程序(加扩展名)>  安装应用到指定模拟器 adb uninstall <程序包名&

adb基本命令总结(Android Debug Bridge)

adb 是PC和设备连接的桥梁,可以通过adb对devices进行相关操作 adb devices           列出你的devices adb kill-server         杀掉adb服务(如果设备连接出问题,可尝试) adb start-server      重启adb服务 adb shell                进入默认device的Linux shell,可以直接执行Linux命令 adb shell screenrecord /sdcard/runCase.

Android Debug Database

https://github.com/amitshekhariitbhu/Android-Debug-Database 为了阅读方便,翻译一下... Android Debug Database is a powerful library for debugging databases and shared preferences in Android applications. ADD 是一个在Android应用开发时 调试 数据库和共享参数 的 强大的库. Android Debug Dat