目录
adb --help:查看帮助手册adb devices:检测连接到电脑的安卓设备adb version:查看adb版本adb start-server:开启adb服务器adb kill-server:关闭adb服务器adb shell:登录设备shelladb logcat:打印日志adb connect/disconnect 设备IP地址:通过WiFi远程连接手机进行调试
adb devices 检测到设备adb tcpip 5555 确定手机端和PC端的通讯端口号adb connect 手机IP地址adb pull <手机路径> <本机路径>:从手机中拉取信息到本机adb push <本机路径> <手机路径>:从本机推送信息到手机adb install app安装包:在手机中安装软件(-r:保留数据和缓存文件)adb uninstall 包名:卸载软件(-k:保留数据和缓存文件)adb reboot recovery:重启到recovery模式adb reboot bootloader:重启到fastboot模式
fastboot reboot:退出fastboot模式adb root:获取设备的root权限adb remount:将“/system”部分置于可写入模式(需要先执行:adb root)adb shell dumpsys 参数:打印出当前系统信息,参数如下:
adb shell am force-stop 包名:强制停止应用adb shell pm list packages:查看所有应用的包名
adb shelllogcat | grep START(cmp=)adb shell dumpsys activity | find "mFocusActivity":查看前台应用启动(activity)名(只是适用于Linux系统和Mac系统)adb shell input tap x y:模拟触屏
adb shell input swipe x1 y1 x2 y2:模拟滑动
(x1,y1)起始坐标点(x2,y2)终止坐标点adb shell input keyevent n:模拟按键(n表示数字)
原文:https://www.cnblogs.com/aaron-zhou/p/12008267.html