ADB命令-Android

    1. adb logcat -c 清空缓存Log
    1. adb logcat -G 2m 扩大缓冲区大小
    1. adb devices 查看连接的设备名称
    1. adb -s xxx shell 连接指定设备,xxx指序列号
    1. adb kill-server && adb start-server 停止、启动adb服务
    1. adb tcpip 5555 && adb connect <手机ip> 通过wifi连接adb
    1. adb disconnect && adb usb 断开wifi、切换至usb模式
    1. adb reboot bootloader && fastboot flashing unlock 进入fastboot模式、unlock解锁
    1. adb root && adb disable-verity && adb reboot 获取root权限、禁用verity、重启
    1. adb root && adb remount 将文件系统重挂载可读写模式
    1. adb reboot recovery && adb sideload xxx.root.zip OTA升级
    1. adb reboot edl 高通平台进入9008口
    1. adb push xxx.file /vendor/ 将文件push至vendor分区
    1. adb install -r xxx.apk 安装apk(-r表示覆盖安装)
    1. adb shell;logcat -v time threadtime > 1.log 打印android log(带线程信息)
    1. adb shell;logcat -v time |grep -E "camera|lcd" 打印android log检索多个关键字
    1. adb shell logcat -v time |findstr /c:"" 打印android log检索单个关键字
    1. adb shell screencap -p sdcard/01.png 截屏
    1. adb shell screenrecord /sdcard/record.mp4 录像
    1. adb shell getprop ro.build.id 查看版本号
    1. adb shell getprop ro.build.type 查看user或者debug版本
    1. adb shell getprop ro.product.model 查看产品名称
    1. adb shell getprop ro.build.version.release 查看android版本号
    1. adb shell getprop ro.kernel.version 查看内核版本
    1. adb shell top 持续监视进程信息
    1. adb shell ps -ef |grep "camera" 查看camera进程的瞬间信息
    1. adb shell kill -9 进程号 强制kill进程
    1. adb shell getenforce 查看selinux状态
    1. adb shell setenforce 0 关闭selinux
    1. adb shell ps -Z 查看进程上下问题
    1. adb shell ls -lZ 查看文件上下文
    1. adb shell getprop -Z 查看属性上下问题
    1. adb shell dumpsys media.camera dump 相机信息
    1. adb shell dumpsys window dump窗口服务信息
    1. adb shell dumpsys battery 查看电池信息:百分比、电压、温度等
    1. adb shell pm list package -f techinfo 查看包名
    1. adb shell pm list package 列出手机所有包名
    1. adb shell dumpsys activity |findstr ResumedActivity 查看包名:先打开应用、再执行命令
    1. adb shell dumpsys activity |findstr camera 查看包名:先打开应用、再执行命令
    1. adb shell am monitor 查看包名:先输入命令、再打开应用
    1. adb shell logcat |grep -i cmp 查看包名
    1. adb shell am start -n com.android.camera2/com.android.camera.CameraLauncher 启动包名:{packageName}/.
    1. adb shell am force-stop com.android.camera2 停止包名
    1. adb shell pm -p com.android.camera2 删除包名
    1. adb shell am startservice 启动服务
    1. adb shell am stopservice 停止服务
    1. adb shell am start -a android.intent.action.VIEW -d http://www.12306.cn 打开12306网站
    1. adb shell am start -a android.intent.action.CALL -d tel:10086 拨打10086
    1. adb shell pm install xxx.apk 安装apk
    1. adb shell pm uninstall xxx.apk 卸载apk
    1. adb shell settings put global airplane_mode_on 1 "打开飞行模式"
    1. adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
    1. adb shell settings put global airplane_mode_on 0 关闭飞行模式
    1. adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
posted @ 2025-12-02 17:44  RichardHuang1  阅读(8)  评论(0)    收藏  举报