【PC和手机连接能力】有关ADB的一些知识
2013-03-17 17:36
453 查看
ADB是 Android Debug Bridge 的简称,在Google的ADT Bundle中已经带了
有关ADB的命令集:
ADB的基本功能:连接PC和电脑
可以实现的高级功能,包括:传输文件和资源,安装APK到手机
ADB可以杀掉ADB,只要权限够。
问题:
1. 如何从ADB拿到状态反馈?
有关ADB的命令集:
Category | Command | Description | Comments |
---|---|---|---|
Target Device | -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"). | See Directing Commands to a Specific Emulator/Device Instance. | |
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 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 exampledev:/dev/omap_csmi_ttyl. [parm]... — zero or more PPP/PPPD options, such asdefaultroute, 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 isdevice. | 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: 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 installrequires the Android package manager, which is available only after the system is fully booted. A command such asadb wait-for-device shell getprop 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.adb wait-for-device install <app>.apk | |
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. |
可以实现的高级功能,包括:传输文件和资源,安装APK到手机
ADB可以杀掉ADB,只要权限够。
问题:
1. 如何从ADB拿到状态反馈?
相关文章推荐
- PC端通过adb命令远程连接手机的相关操作
- 抓取手机数据网络的网络包(一)——安装adb,并pc连接手机
- android手机连接PC后,执行adb shell报daemon not running. starting it now on port 5037 ADB server didn't ACK
- 如何在pc端通过adb连接手机调试,不用usb数据线
- Eclipse连接数据库MySQL以及一些有关数据库的知识
- pc使用adb通过wifi连接到android手机
- 当多个手机同时连接电脑,adb 命令中如何进入指定设备
- [笔记]手机的一些硬件知识
- 有关raw socket的一些知识
- 通过adb命令从手机中复制文件到PC端
- Android手机通过USB线连接PC共享上网
- 关于adb连接手机offline的问题解决
- 有关类加载的一些知识
- 如何让你的PC通过NOKIA手机连接入INTERNET.
- 在Linux下adb连接不上android手机的终极解决方案
- 通过wifi 连接 adb 到 手机
- ADB连接手机的两种方式
- Ubuntu下Android手机通过USB连接PC方法
- 有关类的一些知识
- Android的ADB与手机连接