Ahsan Tarique Ahsan Tarique - 1 year ago 93
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?

Answer Source

Use following

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

More Info here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download