Espresso:回归应用

Espresso: returning to application

我在 Espresso 中进行了测试,在测试结束时,我在应用程序中按下呼叫按钮,这导致 phone.

的拨号屏幕

如何return返回申请? 我想 return 退出应用程序。

pressBack(); 什么都不做。

建议将不胜感激。

 UiDevice mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
mDevice.pressRecentApps();
mDevice.pressRecentApps();

最后还是用了UIAutomator。正是我需要的。