24

Is there a terminal command to go to the home screen?

I need to do this via ssh, so I cannot just push the "home" button, I need to send a command-line action..

Cliff Burton
  • 163
  • 1
  • 6
Andrea
  • 427
  • 2
  • 5
  • 7

3 Answers3

40
am start -a android.intent.action.MAIN -c android.intent.category.HOME

More info about shell commands: an archived version of the AndroidWiki page

Deer Hunter
  • 145
  • 8
Ken Fehling
  • 556
  • 6
  • 9
28

Actually you can just push the "home" button

adb shell input keyevent KEYCODE_HOME

KEYCODE_HOME

Key code constant: Home key. This key is handled by the framework and is never delivered to applications.

Constant Value: 3 (0x00000003)

noraj
  • 103
  • 5
Ilya Gazman
  • 381
  • 4
  • 5
9

Consider taking at look at the following link: http://developer.android.com/reference/android/view/KeyEvent.html

input keyevent KEYCODE_HOME

Keo
  • 191
  • 1
  • 4