4

During glass development, the glass often turns itself off.

How to wake Google Glass via command line or keep Google Glass screen on always during development?

I've tried using various commands like 'input 1 1' or 'sendevent' command from adb to attempt to wake up Google glass, but no lock so far.

Gary S.
  • 394
  • 2
  • 7

1 Answers1

5

A couple options (just make sure that you remove them when you're done testing if you don't want the screen to stay on for the end user):

  1. Add the android:keepScreenOn="true" attribute to your layout, if inflating from an XML file.

  2. Or, set the window's FLAG_KEEP_SCREEN_ON flag in your activity, for example inside onCreate:

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    
Tony Allevato
  • 6,429
  • 1
  • 29
  • 34
  • I understand those options can keep the screen on while the app is running. But I would like to keep the screen on for the glass regardless whether the specific app is running or not. – Gary S. Nov 22 '13 at 06:52
  • If none of the traditional Android ways of doing this work, then please file a feature request in our issue tracker: https://code.google.com/p/google-glass-api/issues/list – Tony Allevato Nov 22 '13 at 14:54