xiaocong / uiautomator

Python wrapper of Android uiautomator test tool.
MIT License
2.01k stars 639 forks source link

uiautomator #286

Open pengyanbing84 opened 4 years ago

pengyanbing84 commented 4 years ago

How to adjust the brightness of the phone to strengthen? How do I press and hold the power button to turn it off?

TRap-github commented 4 years ago

Hi @pengyanbing84 , As I know there no any implementation to adjust brightness in uiautomatior. Even though there is an implementation for long click [e.g.: d.long_click(x, y)] you cannot long press the power button. Direct power button press is only implemented for single click. So, for both actions you may use ADB commands (you can do this using Python). e.g.: Use ADB command to long press power button. then click shutdown button using uiautomator.