Reboot device through REST API

Mobile devices are not designed by their manufacturers to be used for extensive automation testing. Your average user will use their mobile device as a personal device. When using these devices for testing, be it manual or automation, mobile devices can and will experience quirks. It all comes down to the sheer amount of usage that the mobile devices in the cloud will experience. Remember, unless otherwise specified as a simulator or emulator, these devices in your lab, are Real and Live mobile devices.

Rebooting a device can solve the following issues:

  • Slowness
  • Unresponsiveness
  • Low Memory errors
  • Visual Analysis or Object Locating errors

Implementing a scheduled device reboot solution may help to reduce these symptoms, if not eliminate them completely. The following step-by-step instructions walk you through this procedure.

Step-by-step instructions

  1. Use the following API call to create an execution ID for use in the next steps.

    Copy
    https://<cloud URL>.perfectomobile.com/services/executions?operation=start&securityToken=<yourSecurityToken>
  2. Open the Device:

    Copy
    https://<cloud URL>/services/executions/<executionId>?operation=command&securityToken=<yourSecurityToken>&command=device&subcommand=open&param.deviceId=deviceId
  3. Reboot the Device:

    Copy
    https://<cloud URL>/services/executions/<executionId>?operation=command&securityToken=<yourSecurityToken>&command=device&subcommand=reboot&param.deviceId=deviceId
  4. End the Execution:

    Copy
    https://<cloud URL>/services/executions/<executionId>?operation=end&securityToken=<yourSecurityToken>