tags:

views:

30

answers:

1

Hi,

I'm trying to run a few test packages on my device through a shell script which runs every night and for that I need to run the adb reboot command. My problem is that the 'adb reboot' command does make the system reboot, but it never completes (I need to do a keyboard interrupt if I run it manually in order to issue another command) I was wondering if there is anyway I could make my script go to the next command after a certain fixed amount of time? What could be going wrong with the adb reboot command? Sorry if my question is vague.

Thanks.

+1  A: 

adb is waiting for the device to respond, but the device can't respond because it reboots before it responds.

Try a bash script like this:

#!/bin/bash
adb shell &     # run in background
sleep 2         # give it time to run
kill -SIGINT $! # send Ctrl-C to PID of last background process 

** not tested

man kill

bash Internal Variables

superuser