0

I am running automated testing on Android device connected to my laptop over USB. My script starts with two "adb shell" commands before it runs the test as below:

    ::Hey device, wakeup and open the home screen
    adb shell input keyevent 26
    adb shell input touchscreen swipe 240 480 480 640 100
    ...
    (here starts the test cases)

Now, I would like to add "adb reboot" at the very beginning of the script so that my device reboots and starts clean. But the issue is after reboot my device goes following sequences before becoming ready:

  1. Device reboot
  2. Starts connecting to the MDM server (Mobile Device Manager)
  3. While connecting screen plays an progress animation
  4. After successfully connected to the MDM, device become ready

I have tried:

adb reboot
adb wait-for-device shell input keyevent 26

But my problem is that adb wait-for-device shell input keyevent 26 runs right after reboot (sequence #1 above) and after going thru sequences #2,3 & 4, my script does nothing.

How can I check that sequences 2,3 & 4 are complete ?

Jamil Rahman
  • 345
  • 1
  • 6
  • 18
  • One thing you could do is configure an activity to start from a boot receiver, and then check `ps` to see if it is running. – Chris Stratton Mar 22 '18 at 02:59
  • Hello Alex P., I have edited my question with more information, but I don't know how to remove the 'DUPLICATE' tag on that, I hope, you can remove this. – Jamil Rahman Mar 23 '18 at 13:52
  • Some of the ideas found at the linked question should still apply, you'd just need to identify something having to do with the events you want to wait for. – Chris Stratton Mar 23 '18 at 13:59

0 Answers0