如何重新启动杀害Android应用程序与robotium测试重新启动、应用程序、测试、Android

2023-09-07 09:36:34 作者:好好活着@

我使用robotium测试的APK。在这个程序,我有一个按钮,杀死应用进程,并重新推出它。我想用robotium测试该业务情景。 当我点击通过robotium按钮,应用程序被杀害的预期,但我看不到但─它重新登场。

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.

推荐答案

您无法通过robotium做到这一点,仪器测试住在同一进程中的应用程序(你可以看到这一点,如果你看一下logcat中),这意味着,当你杀死你的应用程序处理试验死与它一起。

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.