adb shell的一些用法

一、'grep' 不是内部或外部命令,也不是可运行的程序
或批处理文件。 

处理方式

1. 加引号

adb shell "dumpsys window policy | grep ScreenOn"

2. 换findstr使用

 adb shell dumpsys window policy | findstr isStatusBarKeyguard 

3. 切换用法

adb shell dumpsys window policy^|grep ScreenOn

二、上划解锁

y轴由大到小(这里只能用实际坐标,不能用百分比),暂未找到python方法实现滑动开锁,先考虑用python调用adb命令

adb shell input swipe 500 1200 500 700

三、获取当前手机界面的活动activity

这个命令要研究一下,有哪些信息,哪些可以用到

adbshell dumpsys activity activities
学习的是为了更快、更好的解决问题,不要让学习本身成为问题!
原文地址:https://www.cnblogs.com/testerhome-yizhou2018/p/9471865.html