1. Home
  2. Knowledge Base
  3. SureMDM
  4. How to Execute Remote Key Events on Android Devices via SureMDM
  1. Home
  2. Knowledge Base
  3. Android Management
  4. How to Execute Remote Key Events on Android Devices via SureMDM

How to Execute Remote Key Events on Android Devices via SureMDM

Purpose

This article explains how to remotely simulate hardware key presses on Android devices using the Run Script feature in SureMDM. This allows administrators to perform actions such as pressing the Home, Back, Power, or Volume buttons without physically accessing the device.

Prerequisites

  • Access to the SureMDM Console and Android device(s) enrolled in SureMDM.
  • Permission to use the Run Script feature.
  • Knowledge of the required Android KeyEvent integer value.

Steps 

Steps to Execute a Remote Key Event

  1. On the SureMDM Console -> click on Jobs -> New Job -> Select Android OS
  2. Click on Run Script -> Enter the Job Name and the following script:
    !#suremdm
    pressKey(CONSTANT_VALUE)
  3. Replace CONSTANT_VALUE with the required Android KeyEvent integer and Click on Save.

Example Script 1 – Press the Home Button

!#suremdm

pressKey(3)

Example Script 2 – Press the Back Button

!#suremdm

pressKey(4)

Common Android KeyEvent Values

KeyValue
Home3
Back4
Call5
End Call6
Volume Up24
Volume Down25
Power26
Camera27
Menu82
Search84
App Switch (Recent Apps)187

Expected Result

  • The selected key event is executed on the Android device.
  • The device behaves as though the corresponding physical button was pressed.
  • Administrators can remotely navigate the device interface or perform troubleshooting tasks without physical interaction.

Conclusion

The Remote Key Event Execution feature in SureMDM enables administrators to simulate hardware button presses on managed Android devices. This capability is useful for remote troubleshooting, kiosk management, automation workflows, and general device administration.

Need more help? Here’s how to get help from our experts.

CONTACT US 

Was this helpful?
YesNo
Updated on August 2026
Need Support?
Can't find the answer you're looking for?
Contact Support