adb 命令相关

来源:互联网 发布:限制网速软件 编辑:程序博客网 时间:2024/06/03 19:13
列出所有的应用的包名
adb shell pm list package

-s:列出系统应用
adb shell pm list package -s

-3:列出第三方应用
adb shell pm list package -3

-f:列出应用包名及对应的apk名及存放位置
adb shell pm list package -f

-i:列出应用包名及其安装来源
adb shell pm list package -i

adb shell pm list package -f -3 -i qq

pm path 列出对应包名的 .apk 位置
adb shell pm path com.android.bluetooth
package:/system/app/Bluetooth/Bluetooth.apk

adb shell am start -n com.android.camera/.Camera
adb shell am start -S com.android.camera/.Camera

adb shell am startservice -n com.lgl.test/.MainService

截图命令
adb shell screencap -p /sdcard/screen.png
录制命令,ctrl + c 结束录制
adb shell screenrecord sdcard/record.mp4

adb shell "dumpsys window | grep mCurrentFocus"
adb shell dumpsys activity top

查看这些需要授权的权限组
adb shell pm list permissions -d -g

adb shell pm list packages
adb shell service list

adb shell dumpsys battery
adb shell dumpsys procstats
adb shell dumpsys meminfo
adb shell dumpsys activity
adb shell pm list packages -f
adb shell df
adb shell input keyevent
adb shell input touchscreen

adb shell "dumpsys window | grep mCurrentFocus"
hierarchyviewer

adb shell dumpsys window displays

adb shell getprop | grep ro.sf
[ro.sf.lcd_density]: [360]
[ro.sf.lcd_density_info]: [1080 x 1920px 75mm x 132mm  369 dpi => density: 360]
[ro.sf.lcd_density_origin]: [framebuffer physical dimensions]

查看wifi密码

adb shell cat /data/misc/wifi/*.conf


比如要直接打开wifi可以用如下的命令方式 
adb shell svc wifi enable
adb shell svc
Available commands:
    help     Show information about the subcommands
    power    Control the power manager
    data     Control mobile data connectivity
    wifi     Control the Wi-Fi manager
    usb      Control Usb state

存放在Settings数据库global表中的字段airplane_mode_on表明是否开启了飞行模式
adb shell settings get global airplane_mode_on

清除应用数据
adb shell pm clear com.android.settings

模拟发送广播 
adb shell am broadcast -a android.intent.action.SIM_STATE_CHANGED --es ss ABSENT --ei s

原创粉丝点击