Check ABD Version
command:
adb version
Output:
Android Debug Bridge version 1.0.31
Virtual Keyboard
In adb shell have applied command called "input",通过它可以做一些有趣的事情。
Input command complete help information:
Usage: input [<source>] <command> [<arg>...]
The sources are: mouse keyboard joystick touchnavigation
touchpad trackball stylus dpad
gesture touchscreen gamepad
The commands and default sources are:
text <string> (Default: touchscreen)
keyevent [--longpress] <key code number or name> ... (Default: keyboard)
tap <x><y> (Default: touchscreen) swipe <x1><y1><x2><y2> [duration(ms)] (Default: touchscreen)
press (Default: trackball) roll <dx><dy> (Default: trackball)
比如使用 adb shell input keyevent<keycode> 命令,不同的 keycode 能实现不同的功能,完整的 keycode 列表详见 KeyEvent,摘引部分我觉得有意思的如下:
Keycode | Mean |
3 | Home |
4 | Back |
Keycode | Mean |
5 | Open call phone |
6 | Close call phone |
24 | Add Volume |
25 | Reduce Volume |
26 | Power |
27 | Picture |
64 | Open Browser |
82 | Menu |
85 | Play video |
CPU 信息
命令:
adb shell cat /proc/cpuinfo
输出示例:
Processor : ARMv7 Processor rev 0 (v7l) processor : 0 BogoMIPS : 38.40 processor : 1 BogoMIPS : 38.40 processor : 2 BogoMIPS : 38.40 processor : 3 BogoMIPS : 38.40 Features : swp half thumb fastmult vfp edsp neonvfpv3 tls vfpv4 idiva idivt CPU implementer : 0x51 CPU architecture: 7 CPU variant : 0x2 CPU part : 0x06f CPU revision : 0 Hardware : Qualcomm MSM 8974 HAMMERHEAD (Flattened Device Tree)Revision : 000b Serial : 0000000000000000
這是 Nexus 5 的 CPU 信息,我們從輸出裡可以看到使用的硬件是 Qualcomm MSM 8974,processor的编号是 0 到 3,所以它是四核的,采用的架构是 ARMv7 Processor rev 0 (v71)。
Close USB 调试模式
Command:
adb shell settings put global adb_enabled 0
恢复:
用命令恢复不了了,畢竟关闭了 USB 调试 adb 就连接不上 Android 设备了。
去設備上手動恢復:「settings」-「Developer」-「Usbdebug」。