投屏相关

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

查询xml权限

adb shell dumpsys package com.volvocars.systemui.china | findstr "WATCH_APPOPS"
android.permission.WATCH_APPOPS
android.permission.WATCH_APPOPS: granted=true
android.permission.WATCH_APPOPS: granted=true

查看进程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

设置prop属性

adb shell settings get global volvo.homeButtonState

设置系统时间

adb shell date -s "071716072026"

查询本地数据库

adb shell
su
sqlite3 /data/system/appops/app_op_history_long_interval.db
.tables
.schema 上面返回的数据库名
.headers on
mode column;
SELECT package_name,op_code,access_time,access_count,reject_count,access_duration FROM app_op_accesses ORDER BY access_time DESC LIMIT 10;

切换用户

adb shell am switch-user 11
adb shell pm list users
adb shell am get-current-user

模拟权限行为

adb shell appops start com.volvocars.camera.china CAMERA

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