adb devices
对于每个实例(真机或模拟器)的输出格式如下
[serialNumber] [state]
$ adb devices
List of devices attached
emulator-5554 device
emulator-5556 device
emulator-5558 device
adb install <apk-file-path>
- adb -s <serialNumber> <command>
指定结某个实例进行某项操作
例如:
adb -s emulator-5544 install a.apk
adb push <local path> <remote path>
adb pull <remote path> <local path>
adb help
The table below lists all of the supported adb commands and explains their meaning and usage.
Category
Command
Description
Comments
Options |
-d |
Direct an adb command to the only attached USB device. |
Returns an error if more than one USB device is attached. |
-e |
Direct an adb command to the only running emulator instance. |
Returns an error if more than one emulator instance is running. |
-s<serialNumber> |
Direct an adb command a specific emulator/device instance, referred to by its adb-assigned serial number (such as "emulator-5556"). |
If not specified, adb generates an error. |
General |
devices |
Prints a list of all attached emulator/device instances. |
See Querying for Emulator/Device Instances for more information. |
help |
Prints a list of supported adb commands. |
|
version |
Prints the adb version number. |
|
Debug |
logcat[<option>] [<filter-specs>] |
Prints log data to the screen. |
|
bugreport |
Prints dumpsys , dumpstate , and logcat data to the screen, for the purposes of bug reporting. |
|
jdwp |
Prints a list of available JDWP processes on a given device. |
You can use the forward jdwp:<pid> port-forwarding specification to connect to a specific JDWP process. For example:
adb forward tcp:8000 jdwp:472
jdb -attach localhost:8000
|
Data |
install<path-to-apk> |
Pushes an Android application (specified as a full path to an .apk file) to the data file of an emulator/device. |
|
pull<remote><local> |
Copies a specified file from an emulator/device instance to your development computer. |
|
push<local><remote> |
Copies a specified file from your development computer to an emulator/device instance. |
|
Ports and Networking |
forward<local><remote> |
Forwards socket connections from a specified local port to a specified remote port on the emulator/device instance. |
Port specifications can use these schemes:
tcp:<portnum>
local:<UNIX domain socket name>
dev:<character device name>
jdwp:<pid>
|
ppp<tty>[parm]... |
Run PPP over USB.
-
<tty> — the tty for PPP stream. For example dev:/dev/omap_csmi_ttyl .
-
[parm]... &mdash zero or more PPP/PPPD options, such as defaultroute , local , notty , etc.
Note that you should not automatically start a PPP connection.
|
|
Scripting |
get-serialno |
Prints the adb instance serial number string. |
See Querying for Emulator/Device Instances for more information. |
get-state |
Prints the adb state of an emulator/device instance. |
wait-for-device |
Blocks execution until the device is online — that is, until the instance state is device . |
You can prepend this command to other adb commands, in which case adb will wait until the emulator/device instance is connected before issuing the other commands. Here's an example:
adb wait-for-device shell getprop
Note that this command does not cause adb to wait until the entire system is fully booted. For that reason, you should not prepend it to other commands that require a fully booted system. As an example, the install requires the Android package manager, which is available only after the system is fully booted. A command such as
adb wait-for-device install <app>.apk
would issue the install command as soon as the emulator or device instance connected to the adb server, but before the Android system was fully booted, so it would result in an error. |
Server |
start-server |
Checks whether the adb server process is running and starts it, if not. |
|
kill-server |
Terminates the adb server process. |
|
Shell |
shell |
Starts a remote shell in the target emulator/device instance. |
See Issuing Shell Commands for more information. |
shell[<shellCommand>] |
Issues a shell command in the target emulator/device instance and then exits the remote shell. |
分享到:
相关推荐
在Android开发和测试过程中,熟练掌握ADB命令对于提高工作效率至关重要。本文档将详细介绍ADB在Android平台下的各种应用场景,并通过具体的示例来帮助读者更好地理解和应用这些命令。 #### 二、ADB命令分类 ADB命令...
"Android常用adb命令集锦" Android 平台中,ADB 命令是非常重要的一部分,它提供了许多实用的功能,可以帮助开发者更方便地管理和调试 Android 设备或模拟器。下面将对常用的 ADB 命令进行总结和解释。 1. android...
实际开发总常用adb来调试真机,这是一些常规的命令,欢迎完善
### ADB命令详解 ADB(Android Debug Bridge)是一款功能强大的命令行工具,它为开发者提供了与Android设备进行交互的能力。ADB允许用户管理设备或模拟器的状态,并提供了多种用于调试的功能。本文将详细介绍ADB...
"安卓系统adb命令" 安卓系统adb命令是Android应用程序的常用命令,主要用于Android应用程序的调试、测试和开发。adb命令提供了强大的特性,例如复制文件到设备或从设备复制文件。下面是adb命令的详细介绍: 一、...
### Android ADB命令使用详解 #### 概述 Android Debug Bridge (ADB) 是一款功能强大的命令行工具,它能够帮助开发者管理和调试Android设备或模拟器的状态。本文将详细介绍ADB的基本概念、常用命令及其应用场景。 ...
### 黑域与ADB命令详解 #### 一、黑域(黑阈)简介 黑域是一款专门为Android用户设计的应用程序管理工具,它可以帮助用户更好地控制手机中的应用行为,特别是针对那些常常在后台“全家桶”式的自启动和互相唤醒的...
总结起来,这个项目展示了如何利用C#结合ADB命令,实现对Android设备的自动化控制,特别是在微信“跳一跳”游戏中。通过这样的技术,开发者可以创建类似的游戏辅助工具,提高游戏体验,同时,这也是一种深入理解ADB...
### ADB命令大全详解 #### 一、ADB基础命令与功能概述 ADB(Android Debug Bridge)是Android系统中一个非常重要的工具,它提供了一系列的命令用于实现设备与计算机之间的交互,包括但不限于安装软件包、查看日志...
### Android调试桥(ADB)命令...总结,ADB是Android开发者和测试工程师不可或缺的工具,通过熟练掌握ADB命令,能够极大地提升开发效率和测试质量。无论是简单的文件操作还是复杂的调试任务,ADB都能提供有力的支持。
### 移动端测试工具adb命令大全 #### 一、adb简介 adb(Android Debug Bridge)是一种功能强大的命令行工具,用于实现与Android模拟器或实际设备之间的通信。它支持多种设备上的操作,例如安装和调试应用程序。对于...
总结来说,"Delphi XE ADB 操作" 是指在 Delphi XE 开发环境中利用 ADB 工具与 Android 设备进行交互,涵盖了设备控制、数据传输、日志收集等多个方面。通过合理利用这一技术,开发者可以高效地调试 Android 应用、...
### Android ADB命令详解 #### 一、ADB简介 Android Debug Bridge(简称ADB)是Android提供的一个命令行工具,主要用于实现计算机与Android设备之间的通信。它不仅能够帮助开发者完成应用程序的安装、调试等功能,...
总结来说,Android应用执行`adb shell`命令主要依赖于Java层的`Runtime`或`Process`类,而原生层可以通过`system()`或`popen()`函数实现。在实际项目中,开发者应确保对命令的权限控制和错误处理有充分的理解,以...
总结,adb作为Android开发者的重要工具,其强大的功能涵盖了设备管理、文件操作、应用生命周期控制、日志分析等多个方面,熟练掌握adb命令能够极大地提高开发效率,解决各种问题。在日常开发、测试和故障排查中,...
adb shell命令总结.txt
### Android ADB命令大全知识点详解 #### 一、概述 ADB (Android Debug Bridge) 是一个命令行工具,用于与Android设备进行通信。它提供了一系列的命令来帮助开发者调试应用程序、管理设备状态等。本文将详细介绍ADB...
### Android ADB命令详解 #### 一、ADB概述 ADB(Android Debug Bridge)是Android操作系统提供的一个强大的命令行工具,用于实现计算机与Android设备(包括真实设备和模拟器)之间的通信。通过ADB,开发者可以...
为了更好地理解和使用ADB工具,下面我们详细介绍几个常用的ADB命令及其应用场景。 1. **查看连接的设备**: ```bash adb devices ``` 此命令用于查看当前连接到计算机的Android设备或模拟器列表。如果设备成功...
总结起来,这个资源包是针对Windows 7用户的一站式解决方案,包含了进行Android开发和调试所需的ADB命令工具和驱动安装程序。掌握这些知识和技能,可以帮助开发者更高效地在Windows 7环境下与Android设备交互,进行...