S-View Clocks for Note 4

Do you want a classy clock for your classy S-View cover? XDA Recognized Themersibinnhas provided us very … more

1% Battery Mod Themes for M8 Lollipop

If you have the battery-themer mod “1% battery”, this collection fromXDA Recognized Themer … more

No Timeline for Wi-Fi Direct Vulnerability , Says Google

CoreSecurity and Google have an ongoing dispute over the nature of a Wi-Fi Direct … more

Android Is the First Mobile OS to Ship 1 Billion Devices In a Year

Another milestone for Android! According to Strategy Analytics’ … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[APP] Wakey Droid - wake device over usb with adb

OP bdjnk

8th December 2010, 07:42 PM   |  #1  
bdjnk's Avatar
OP Member
Thanks Meter: 11
33 posts
Join Date:Joined: Jul 2010
Wakey Droid allows you to wake your Android device from your computer over USB with the command adb shell am start -a android.intent.action.MAIN -n bdjnk.android.wakeydroid/.Wakey.

It is incredibly simple and works great (for me at least) but I'm sure it could be made better. The entire code is right below. If you've any suggestions, let me know. (hehe, it rhymes).

package bdjnk.android.wakeydroid;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.PowerManager;

public class Wakey extends Activity {

    private static PowerManager.WakeLock wakeLock;
    protected void onCreate(Bundle savedInstanceState) {

        PowerManager pm = (PowerManager) getApplicationContext().getSystemService(Context.POWER_SERVICE);
      	wakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE,"okTag");

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    <uses-sdk android:minSdkVersion="4" />
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Wakey"
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.MONKEY" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />  
Last edited by bdjnk; 8th December 2010 at 08:14 PM. Reason: title correction
The Following 5 Users Say Thank You to bdjnk For This Useful Post: [ View ]
14th May 2011, 06:34 PM   |  #2  
the2dcour's Avatar
Senior Member
Flag Boston
Thanks Meter: 585
462 posts
Join Date:Joined: Mar 2011
Donate to Me
only suggestion I would have is maybe some way to configure what kind of wakelock you get (other than editing your code ) Great app, just what I needed thanks.
12th December 2011, 04:59 PM   |  #3  
Senior Member
Flag Cartago
Thanks Meter: 7
151 posts
Join Date:Joined: Aug 2008
Thanks for this useful tool. It is exactly what I was looking for. However, it doesn't work on my Xperia Mini Pro with Android 2.3.4. I installed the Wakey Droid on the phone and when I issue the command via adb the device doesn't wake up.

I have the latest ADB version working on my laptop. All ADB commands work properly.

This is what I get when I run the command:


C:\>adb shell am start -a android.intent.action.MAIN -n bdjnk.android.wakeydroid
Starting: Intent { act=android.intent.action.MAIN cmp=bdjnk.android.wakeydroid/.
Wakey }

Any help will be greatly appreciated.
3rd July 2012, 02:42 PM   |  #4  
bdjnk's Avatar
OP Member
Thanks Meter: 11
33 posts
Join Date:Joined: Jul 2010
New Version - Fundamental Changes
I've released a new version that should now work despite (unsecured) lock-screens. Overall it is a much better design and should work on more devices.

Complete source code:

Listing on Google Play:

p.s. Apologies if I'm not supposed to be reviving dead threads (making zombies!), but I took a look through various posting rules and didn't see it mentioned.
The Following 2 Users Say Thank You to bdjnk For This Useful Post: [ View ]
3rd July 2012, 02:55 PM   |  #5  
Senior Member
Flag Cartago
Thanks Meter: 7
151 posts
Join Date:Joined: Aug 2008
It's working 100% on my Sony Ericsson Mini Pro (sk17a). Thanks so much!
30th October 2012, 04:25 PM   |  #6  
Junior Member
Thanks Meter: 0
13 posts
Join Date:Joined: Dec 2008
APK where ?

where can I download the apk directly, I do not use the Google store ?
26th April 2013, 11:59 AM   |  #7  
Junior Member
Thanks Meter: 3
2 posts
Join Date:Joined: Jan 2013
Originally Posted by ptosch


where can I download the apk directly, I do not use the Google store ?

Not sure if this only works on Jelly Bean or if it works on earlier versions of Android, but if you have adb already installed, try starting a shell by typing "adb shell" at a command prompt, and then type "input keyevent POWER" and your phone will wake up. You can then type "input keyevent MENU" to bypass your (unprotected) lock screen. (If you are interested or your touchscreen breaks, there are many other keyevent commands as well as tap and swipe commands which you can google.)

[PS: Your phone must be connected by usb. No app is needed.]
Last edited by hallwal; 26th April 2013 at 12:13 PM.
The Following 2 Users Say Thank You to hallwal For This Useful Post: [ View ]
26th April 2013, 12:43 PM   |  #8  
rgawenda's Avatar
Senior Member
Thanks Meter: 77
249 posts
Join Date:Joined: Jul 2009
Info 2
Try this:

adb shell "input keyevent 26"
(edit: oops, missed previous post, please ignore)
21st July 2014, 12:31 PM   |  #9  
Junior Member
Flag Revava
Thanks Meter: 0
29 posts
Join Date:Joined: Jul 2012
It's not working for me, when i run it i get:
Starting: Intent { act=android.intent.action.MAIN cmp=bdjnk.android.wakeydroid/.Wakey. }
Error type 3
Error: Activity class {bdjnk.android.wakeydroid/bdjnk.android.wakeydroid.Wakey.} does not exist.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes