投屏相关

D:\scrcpy-win64-v2.1.1\scrcpy.exe --display=2

D:\scrcpy-win64-v3.3.4\scrcpy.exe --display-id=2

模拟按键

adb shell input keyevent 4

禁用应用

adb shell pm disable-user com.test

启用应用

adb shell pm enable com.test

允许执行未授权操作(如未签名应用访问系统资源)

adb shell getenforce  # 输出 "Permissive" 表示成功

adb shell setenforce 0

dump相关

adb shell dumpsys meminfo com.test > d:/dumpsys_mem.txt

adb shell dumpsys input > input.log
adb shell dumpsys activity com.test> actdump.log
adb shell dumpsys window windows > dumpsys_w.txt
adb shell dumpsys SurfaceFlinger > dumpsys_sf.txt

查看进程cpu

获取前台进程包名 adb shell dumpsys window | findstr mCurrentFocus
通过包名获取PID
adb shell ps | findstr com.cubic.autohome
监控进程CPU
adb shell top -p 8971 -u u0_a179

copy文件

adb pull /mnt/log/DHU7  C:\Users\Desktop

删除文件

adb shell rm -r mnt/log/DHU7

adb shell rm -rf  /mnt/scratch/overlay

分辨率相关

adb shell wm size 3200x2000

adb shell wm size reset

adb shell wm density 240

adb shell wm density reset

adb shell wm density 240 -d 2

startActivity

adb shell am start -n  com.test/com.test.activity.MainActivity --display 2

发送广播

adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -n com.test/.receiver.TestReceiver

adb shell am broadcast -a com.intent.action.CONTROL_BOARD_CLOSE

查询设备存储

adb shell df -h
adb shell df -h /sdcard

拉去当前日志

adb logcat -v time > log/logcat.log

结束进程

adb shell am force-stop com.test

adb shell ps | findstr ecarx.launcher3
adb shell kill 18721

切换深浅色

adb shell "cmd uimode night yes"

查询应用版本

adb shell dumpsys package  ecarx.launcher3 | findstr version

打开系统设置

adb shell am start -a android.settings.SETTINGS

清楚应用缓存

adb shell pm clear com.test

所有运行的进程

adb shell
ps -A|grep multi

所有屏幕信息

adb shell

dumpsys display | grep mBaseDis

push

git push origin HEAD:refs/for/master

 

posted on 2026-07-03 15:00  翻滚的咸鱼  阅读(4)  评论(0)    收藏  举报