android中adb命令最全总结

本文主要介绍了android中adb命令最全总结,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

 一、查看adb版本

adb version

 C:\Users\Administrator>adb version Android Debug Bridge version 1.0.41 Version 30.0.4-6686687 Installed as E:\platform-tools\adb.exe 

二、查看已经连接的设备

adb devices

 C:\Users\Administrator>adb devices List of devices attached 127.0.0.1:7555  device 

三、获取手机序列号

adb get-serialno

 C:\Users\Administrator>adb get-serialno 127.0.0.1:7555 

四、查看手机设别型号

adb shell getprop ro.product.model

 C:\Users\Administrator>adb shell getprop ro.product.model Xiaomi 

五、查看手机分辨率

adb shell wm size

 C:\Users\Administrator>adb shell wm size Physical size: 1440x810 

六、获取手机的mac地址

adb shell cat /sys/class/net/wlan0/address

 C:\Users\Administrator>adb shell cat /sys/class/net/wlan0/address 08:00:27:7e:49:9c 

七、查看日志

adb logcat

 C:\Users\Administrator>adb logcat 

八、查看电池信息

adb shell dumpsys battery

 C:\Users\Administrator>adb shell dumpsys battery Current Battery Service state: AC powered: true USB powered: false Wireless powered: false Max charging current: 2000000 status: 2 health: 2 present: true level: 72 scale: 100 voltage: 4036 temperature: 326 technology: Li-poly 

九、查看进程

adb shell ps

 C:\Users\Administrator>adb shell ps USER      PID   PPID  VSIZE  RSS   WCHAN            PC  NAME root      1     0     2732   1272     ep_poll 08126b35 S /init root      2     0     0      0       kthreadd 00000000 S kthreadd root      3     2     0      0     smpboot_th 00000000 S ksoftirqd/0 root      5     2     0      0     worker_thr 00000000 S kworker/0:0H 

十、查看cpu使用情况

adb shell top

 C:\Users\Administrator>adb shell top 

十一、安装apk

  • apk文件需要放到你命令执行的文件夹下,或者写上apk的绝对路径
  • adb install [apk文件的路径]
 C:\Users\Administrator>adb install douyin.apk Performing Push Install 
  • 多个设备安装apk
  • adb -s [设备号] install [apk文件的路径]
 C:\Users\Administrator>adb -s 127.0.0.1:7555 install douyin.apk Performing Push Install 
  • 如果apk已经存在,需要覆盖安装
  • adb install -r [apk文件的路径]
 C:\Users\Administrator>adb instal

以上就是android中adb命令最全总结的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » 移动