android中adb命令最全总结
adb version
C:UsersAdministrator>adb versionAndroid Debug Bridge version 1.0.41Version 30.0.4-6686687Installed as E:platform-toolsadb.exe二、查看已经连接的设备
adb devices
C:UsersAdministrator>adb devicesList of devices attached127.0.0.1:7555 device三、获取手机序列号
adb get-serialno
C:UsersAdministrator>adb get-serialno127.0.0.1:7555四、查看手机设别型号
adb shell getprop ro.product.model
C:UsersAdministrator>adb shell getprop ro.product.modelXiaomi五、查看手机分辨率
adb shell wm size
C:UsersAdministrator>adb shell wm sizePhysical size: 1440x810六、获取手机的mac地址
adb shell cat /sys/class/net/wlan0/address
C:UsersAdministrator>adb shell cat /sys/class/net/wlan0/address08:00:27:7e:49:9c七、查看日志
adb logcat
C:UsersAdministrator>adb logcat八、查看电池信息
adb shell dumpsys battery
C:UsersAdministrator>adb shell dumpsys batteryCurrent 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:UsersAdministrator>adb shell psUSER PID PPID VSIZE RSS WCHAN PC NAMEroot 1 0 2732 1272 ep_poll 08126b35 S /initroot 2 0 0 0 kthreadd 00000000 S kthreaddroot 3 2 0 0 smpboot_th 00000000 S ksoftirqd/0root 5 2 0 0 worker_thr 00000000 S kworker/0:0H十、查看cpu使用情况
adb shell top
C:UsersAdministrator>adb shell top十一、安装apk apk文件需要放到你命令执行的文件夹下,或者写上apk的绝对路径 adb install [apk文件的路径]
C:UsersAdministrator>adb install douyin.apkPerforming Push Install 多个设备安装apk adb -s [设备号] install [apk文件的路径]
C:UsersAdministrator>adb -s 127.0.0.1:7555 install douyin.apkPerforming Push Install 如果apk已经存在,需要覆盖安装 adb install -r [apk文件的路径]
C:UsersAdministrator>adb install -r douyin.apkPerforming Push Install十二、卸载apk 普通卸载 adb uninstall [apk文件的路径]
C:UsersAdministrator>adb uninstall douyin.apk 卸载但是保留数据 adb uninstall -k [apk文件的路径]
C:UsersAdministrator>adb uninstall -k douyin.apk十三、查看手机上所有安装的app包名
adb shell pm list packages
C:UsersAdministrator>adb shell pm list packagespackage:com.rxgx.xx.ldzwpackage:com.tanwan.h5.xrxhjpackage:com.xinxin.mobile.dsfhpackage:com.xinxin.mobile.llwgpackage:com.android.providers.telephonypackage:com.xinxin.H5.jbdfhycpackage: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:UsersAdministrator>adb shell dumpsys package com.ss.android.ugc.aweme | findstr activityad29111 com.ss.android.ugc.aweme/com.ss.android.sdk.activity.BootstrapActivity 十五、启动某个app
adb shell am start -n [包名]/[启动入口]
C:UsersAdministrator>adb shell am start -n com.ss.android.ugc.aweme/com.ss.android.sdk.activity.BootstrapActivityStarting: Intent { cmp=com.ss.android.ugc.aweme/com.ss.android.sdk.activity.BootstrapActivity }十六、屏幕截图
adb shell screencap [保存路径]
C:UsersAdministrator>adb shell screencap /sdcard/screen.png十七、录制视频
adb shell screenrecord [保存路径]
C:UsersAdministrator>adb shell screenrecord /sdcard/demo.mp4十八、上传文件到手机
adb push 文件名 手机端SDCard路径
C:UsersAdministrator>adb push douyin.apk sdcard/douyin.apk十九、从手机端下载文件
adb pull [手机上文件路径]
C:UsersAdministrator>adb pull sdcard/douyin.apk二十、模拟屏幕点击事件
adb shell input tap x坐标轴 y坐标轴
C:UsersAdministrator>adb shell input tap 500 1450二十一、模拟手势滑动事件
adb shell input swipe 开始x轴 开始y轴 结束x轴 结束y轴 过程持续时间毫秒
C:UsersAdministrator>adb shell input swipe 100 500 100 1450 100二十二、模拟点按键盘按钮
adb shell input keyevent [key值]
C:UsersAdministrator>adb shell input keyevent 25二十三、向屏幕输入一些信息 db shell input text [字符串信息] %s是空格
C:UsersAdministrator>db shell input text 'insert%stext%shere'二十四、发送广播
adb shell am broadcast -a 'broadcastactionfilter'
C:UsersAdministrator>adb shell am broadcast -a 'broadcastactionfilter'二十五、使用自带浏览器打开网页
adb shell am start -a [浏览器包名] -d [网址]
C:UsersAdministrator>adb shell am start -a 'android.intent.action.VIEW' -d https://www.google.com二十六、获取手机root权限
adb vivoroot
C:UsersAdministrator>adb vivoroot二十七、连接不稳定时需要挂载
adb remount
C:UsersAdministrator>adb remount二十八、重启手机
正常重启
C:UsersAdministrator>adb reboot
重启手机到recovery
C:UsersAdministrator>adb reboot recovery
重启到bootloader界面
C:UsersAdministrator>adb reboot bootloader二十九、关闭adb服务
C:UsersAdministrator>adb kill-server三十、启动adb服务
C:UsersAdministrator>adb start-server
到此这篇关于android中adb命令最全总结的文章就介绍到这了,更多相关android adb命令 内容请搜索好吧啦网以前的文章或继续浏览下面的相关文章希望大家以后多多支持好吧啦网!
相关文章: