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:
- Device reboot
- Starts connecting to the MDM server (Mobile Device Manager)
- While connecting screen plays an progress animation
- 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 ?