You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否在Android Instrumentation测试中触发进程销毁场景?

Android Instrumentation测试进程重启需求说明

目前通过Google搜索无法找到有效解决方案,Android Instrumentation测试并没有直接实现杀死并重启应用进程这一需求的方法。

以下是测试代码的基础框架:

class TestWithActivity {
  @get:Rule
  val composeRule: TestActivityRule = createAndroidComposeRule()

  @Test
  fun testStateRestorationAfterProcessDeath(): Unit = with(composeRule) {
    // 此处需要实现杀死并重启应用进程的逻辑
  }
}

内容的提问来源于stack exchange,提问作者xxfast

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 09:34:54