问题
I am testing an apk using robotium. In this app, I have a button which kills the app process and relaunches it. I want to test this scenario using robotium. When I click on the button through robotium, app is killed as expected but I cannot see that- it relaunches.
回答1:
You cannot do this via robotium, Instrumentation tests live in the same process as your application (you can see this if you look at logcat) this means that when you kill your applications process the tests die along with it.
来源:https://stackoverflow.com/questions/13802233/how-to-restart-killed-android-application-in-testing-with-robotium