这篇文章主要介绍了Android中adb命令有哪些,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。 一、查看adb版本adb versionC:\Users\Admi
这篇文章主要介绍了Android中adb命令有哪些,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
adb version
C:\Users\Administrator>adb versionAndroid Debug Bridge version 1.0.41Version 30.0.4-6686687Installed as E:\platfORM-tools\adb.exe
adb devices
C:\Users\Administrator>adb devicesList of devices attached127.0.0.1:7555 device
adb get-serialno
C:\Users\Administrator>adb get-serialno127.0.0.1:7555
adb shell getprop ro.product.model
C:\Users\Administrator>adb shell getprop ro.product.modelXiaomi
adb shell wm size
C:\Users\Administrator>adb shell wm sizePhysical size: 1440x810
adb shell cat /sys/class/net/wlan0/address
C:\Users\Administrator>adb shell cat /sys/class/net/wlan0/address08:00:27:7e:49:9c
adb loGCat
C:\Users\Administrator>adb logcat
adb shell dumpsys battery
C:\Users\Administrator>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:\Users\Administrator>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
adb shell top
C:\Users\Administrator>adb shell top
apk文件需要放到你命令执行的文件夹下,或者写上apk的绝对路径
adb install [apk文件的路径]
C:\Users\Administrator>adb install douyin.apkPerforming Push Install
多个设备安装apk
adb -s [设备号] install [apk文件的路径]
C:\Users\Administrator>adb -s 127.0.0.1:7555 install douyin.apkPerforming Push Install
如果apk已经存在,需要覆盖安装
adb install -r [apk文件的路径]
C:\Users\Administrator>adb install -r douyin.apkPerforming Push Install
普通卸载
adb uninstall [apk文件的路径]
C:\Users\Administrator>adb uninstall douyin.apk
卸载但是保留数据
adb uninstall -k [apk文件的路径]
C:\Users\Administrator>adb uninstall -k douyin.apk
adb shell pm list packages
C:\Users\Administrator>adb shell pm list packagespackage:com.rxgx.xx.ldzwpackage:com.tanwan.h6.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:\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
adb shell am start -n [包名]/[启动入口]
C:\Users\Administrator>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:\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 https://www.Google.com
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
C:\Users\Administrator>adb kill-server
C:\Users\Administrator>adb start-server
感谢你能够认真阅读完这篇文章,希望小编分享的“android中adb命令有哪些”这篇文章对大家有帮助,同时也希望大家多多支持编程网,关注编程网精选频道,更多相关知识等着你来学习!
--结束END--
本文标题: android中adb命令有哪些
本文链接: https://lsjlt.com/news/298734.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0