ADB 指令練習

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
3Home
4Back
KeycodeMean
5Open call phone
6Close call phone
24Add Volume
25Reduce Volume
26Power
27Picture
64Open Browser
82Menu
85Play video
ex:  adb shell input keyevent 82

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 8974processor的编号是 0 3,所以它是四核的,采用的架构是 ARMv7 Processor rev 0 (v71)

Close USB 调试模式

Command:

adb shell settings put global adb_enabled 0 

恢复:

用命令恢复不了了,畢竟关闭了 USB 调试 adb 就连接不上 Android 设备了。

去設備上手動恢復:「settings」-「Developer」-「Usbdebug」。

參考資料

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值