Ahsan Tarique Ahsan Tarique - 6 months ago 39
Android Question

Terminate process after some time in ADB shell

I am running an app from ADB shell like this:

adb shell am start -n mypackage/.MainActivity

I need to terminate the app automatically after 10 seconds and start another application.
I am trying to do something like this:

adb shell timeout -t 10 am start -n mypackage/.MainActivity

But unfortunately this does not work.


/system/bin/sh: timeout not found

Is there any way to make this work?


Use following

adb shell am start -n mypackage1/.MainActivity
sleep 10
kill  mypackage1
adb shell am start -n mypackage2/.MainActivity

More Info here