I am developing an automated test script to turn off my android device and turn it on back again and then run a few adb commands after the boot is complete.

My problem is that when I turn the device off and turn it on back again, the sys.boot_completed flag is true , showing that the device is on, but any command such as adb -s <device_id> shell returns a device not found error.

I tried inserting delays between commands and sleep for boot completion but this error sometimes shows up after a few reboot cycles.

Is there a way to automize reboot with some post-reboot sanity check ?

  • check the device's usb connection mode. enable MTP and try.
    – siva
    Jul 4 '16 at 11:28
  • it is actually an Android TV, I am afraid I cant do that. Jul 5 '16 at 5:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.