android中adb命令最全总结⽬录
⼀、查看adb版本
⼆、查看已经连接的设备
三、获取⼿机序列号
四、查看⼿机设别型号
五、查看⼿机分辨率
六、获取⼿机的mac地址
七、查看⽇志
⼋、查看电池信息
九、查看进程
⼗、查看cpu使⽤情况
⼗⼀、安装apk
⼗⼆、卸载apk
⼗三、查看⼿机上所有安装的app包名
⼗四、获取某个应⽤包名的启动⼊⼝
⼗五、启动某个app
⼗六、屏幕截图
⼗七、录制视频
⼗⼋、上传⽂件到⼿机
⼗九、从⼿机端下载⽂件
⼆⼗、模拟屏幕点击事件
⼆⼗⼀、模拟⼿势滑动事件
⼆⼗⼆、模拟点按键盘按钮
⼆⼗三、向屏幕输⼊⼀些信息
⼆⼗四、发送⼴播
⼆⼗五、使⽤⾃带浏览器打开⽹页
⼆⼗六、获取⼿机root权限
⼆⼗七、连接不稳定时需要挂载
⼆⼗⼋、重启⼿机
⼆⼗九、关闭adb服务
三⼗、启动adb服务
⼀、查看adb版本
adb version
C:\Users\Administrator>adb version
Android Debug Bridge version 1.0.41
Version 30.0.4-6686687
Installed as E:\
⼆、查看已经连接的设备
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 del
C:\Users\Administrator>adb shell getprop del
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
android学习教程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 install -r douyin.apk
Performing Push Install
⼗⼆、卸载apk
普通卸载
adb uninstall [apk⽂件的路径]
C:\Users\Administrator>adb uninstall douyin.apk
卸载但是保留数据
adb uninstall -k [apk⽂件的路径]
C:\Users\Administrator>adb uninstall -k douyin.apk
⼗三、查看⼿机上所有安装的app包名
adb shell pm list packages
C:\Users\Administrator>adb shell pm list packages
x.ldzw
package:com.hj
package:bile.dsfh
package:bile.llwg
package:com.lephony
package:com.xinxin.H5.jbdfhyc
package:com.ss.android.ugc.aweme
⼗四、获取某个应⽤包名的启动⼊⼝
adb shell dumpsys package com.ss.android.ugc.aweme | findstr activity
com.ss.android.ugc.aweme/com.ss.android.sdk.activity.BootstrapActivity 这个就是抖⾳的启动⼊⼝C:\Users\Administrator>adb shell dumpsys package com.ss.android.ugc.aweme | findstr activity
ad29111 com.ss.android.ugc.aweme/com.ss.android.sdk.activity.BootstrapActivity
⼗五、启动某个app
adb shell am start -n [包名]/[启动⼊⼝]
C:\Users\Administrator>adb shell am start -n com.ss.android.ugc.aweme/com.ss.android.sdk.activity.BootstrapActi
vity
Starting: Intent { cmp=com.ss.android.ugc.aweme/com.ss.android.sdk.activity.BootstrapActivity }
⼗六、屏幕截图
adb shell screencap [保存路径]
C:\Users\Administrator>adb shell screencap /sdcard/screen.png
⼗七、录制视频
adb shell screenrecord [保存路径]
C:\Users\Administrator>adb shell screenrecord /sdcard/demo.mp4
⼗⼋、上传⽂件到⼿机
adb push ⽂件名⼿机端SDCard路径
C:\Users\Administrator>adb push douyin.apk sdcard/douyin.apk
⼗九、从⼿机端下载⽂件
adb pull [⼿机上⽂件路径]
C:\Users\Administrator>adb pull sdcard/douyin.apk
⼆⼗、模拟屏幕点击事件
adb shell input tap x坐标轴 y坐标轴
C:\Users\Administrator>adb shell input tap 500 1450
⼆⼗⼀、模拟⼿势滑动事件
adb shell input swipe 开始x轴开始y轴结束x轴结束y轴过程持续时间毫秒
C:\Users\Administrator>adb shell input swipe 100 500 100 1450 100
⼆⼗⼆、模拟点按键盘按钮
adb shell input keyevent [key值]
C:\Users\Administrator>adb shell input keyevent 25
⼆⼗三、向屏幕输⼊⼀些信息
db shell input text [字符串信息]
%s是空格
C:\Users\Administrator>db shell input text "insert%stext%shere"
⼆⼗四、发送⼴播
adb shell am broadcast -a "broadcastactionfilter"
C:\Users\Administrator>adb shell am broadcast -a "broadcastactionfilter"
⼆⼗五、使⽤⾃带浏览器打开⽹页
adb shell am start -a [浏览器包名] -d [⽹址]
C:\Users\Administrator>adb shell am start -a "android.intent.action.VIEW" -d le
⼆⼗六、获取⼿机root权限
adb vivoroot
C:\Users\Administrator>adb vivoroot
⼆⼗七、连接不稳定时需要挂载
adb remount
C:\Users\Administrator>adb remount
⼆⼗⼋、重启⼿机
正常重启
C:\Users\Administrator>adb reboot
重启⼿机到recovery
C:\Users\Administrator>adb reboot recovery
重启到bootloader界⾯
C:\Users\Administrator>adb reboot bootloader
⼆⼗九、关闭adb服务
C:\Users\Administrator>adb kill-server
三⼗、启动adb服务
C:\Users\Administrator>adb start-server
到此这篇关于android中adb命令最全总结的⽂章就介绍到这了,更多相关android adb命令内容请搜索以前的⽂章或继续浏览下⾯的相关⽂章希望⼤家以后多多⽀持!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论