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 changes in Eclipse. 2. In the meantime screen goes off or not. 3. I run "debug" and want force screen to wake up.
I found a method with "power key" emulation but it does not turn it on but rather toggles the power state. I do not want to add extra code to my application. What are the other methods to do such trivial task, please help.
Enable adb debugging on your device To make it visible, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options at the bottom. On some devices, the Developer options screen might be located or named differently. You can now connect your device with USB.
Boot your phone into Android, then connect it to your desktop computer with a USB cable. On your computer, launch the Command Prompt and change the directory to point to the platform-tools folder. Type adb devices and hit Enter.
To use ADB with your Android device, you must enable a feature called “USB Debugging.” Open your phone's app drawer, tap the Settings icon, and select “About Phone”. Scroll all the way down and tap the “Build Number” item seven times. You should get a message saying you are now a developer.
adb shell input keyevent KEYCODE_WAKEUP
As described here, this wakes up the device. Behaves somewhat like KEYCODE_POWER but it has no effect if the device is already awake.
To toggle sleep/wake with one command you can issue
adb shell input keyevent KEYCODE_POWER
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With