How to wake up Android with use adb - I want to wake up (if asleep) Android terminal before debugging every new version of application.
Typical flow is: 1. I do some cha
For Windows and Eclipse you can use .bat file:
@ECHO OFF
setlocal
for /f "delims= tokens=1*" %%a in ('adb shell dumpsys power ^| findstr.exe "mScreenOn="') DO (
for /f "delims== tokens=2*" %%S in ("%%a") do (
if "%%S" == "false" (goto move1) else (goto move2)
)
)
:move1
adb shell input keyevent 26
goto end
:move2
goto end
:end
exit
It will check, if screen is off it will switch the power state. To use it with Eclipse this .bat file should be used as "External tool" (just fill the path to the .bat) and linked to the project in it's properties (Builders - Import - ).