android 调试桥 是一种多样的命令行工具。
客户端:用于发送命令。当启动某个
adb version ## 查看版本 adb devices ## 查看连接设备 adb --help adb start-server ## 查看5037端口的进程 netstat -ano|findstr "5037"|more ## taskkill /F 15356 cls ##清理屏幕 ##启动原生模拟器 emulator -list-avds
连接夜深模拟器的快捷方式 创建一个批处理文件
e: cd E:App_for_devlopernoxNoxbin nox_adb.exe connect 127.0.0.1:62001 #不加pause就一闪而过 pause安装卸载
## 切换到apk路径下,用命令进行安装 adbs -s 127.0.0.1:62001 install todolist.apk adbs -s 127.0.0.1:62001 install -r todolist.apk adbs -s 127.0.0.1:62001 shell cd d adbs -s 127.0.0.1:62001 shell pm uninstall -k## -k 表示不保留历史数据 adb shell pm uninstall -k com.example.todolist ## adb shell pm uninstall -k com.example.todolist ##将文件复制到设备 上传到data路径下 adb push 20210929.txt /data ## adb shell cd data exit ##下载 adb pull data/faill.txt data/0929.txt d:/demo ## 日志打印本地 adb logcat > E:/demo/test.log adb logcat *:W##warn 级别的 adb logcat *:F## adb logcat > d:demo20210929.txt ## 查看 ActivityManager 或者Display adb logcat |findstr "ActivityManger" >> d:demo20210929.txt ## > 覆盖 ## >> 增加 ## |findstr "ActivityManger" 过滤特定字符 ## 查找包名 adb logcat > d:demo20210929.txt ## 查看 端口转发 adb forward --list ##设置端口转发 从8000到9000 adb forward tcp:8000 tcp:9999 ## adb shell 就是进入Linux adb shell ls 查看路径下有哪些文件 ##查看详细信息 ls -s ls -l ## 查看安装包程序 pm list packages ## linux的管道服务grep , windows下是findstr pm list packages |grep qq ##查看关联文件 pm list package -f qq ## 过滤第三方 pm list packages -3 ##相等与grap pm list packages -3 meituan查找包名
##shell下 exit ##退出 ##打开QQ adb shell am start -W -S com.tencent.mobileqq/.activity.SplasActivity ##停止QQ adb shell am force-stop com.tencent.mobileqq ## (安装前)方法1:每一个版本下都有 去看清单文件 可以看包名 用户权限 aapt dump bading d:meituan.apk | findstr lanchable-activity ##(安装后) 方法2:直接查找包名 (不推荐使用) pm list packages |grep qq ## ##(安装后) 方法2:直接查找包名 adb logcat |findstr "ActivityManger" > d:demo20210929.txt
## 获取当前页面的元素 adb shell dumpsys activity top ##获取当前任务列表 adb shell dumpsys activity activities ##获取特定包的信息 adb shell dumpsus packages com.zhihu.daily.android
adb logcat |findstr "Displayed" > d:demo20210929.txt



