Is it possible to find out if an Android application runs as part of an instrumentation test

前端 未结 8 1198
孤独总比滥情好
孤独总比滥情好 2021-01-04 11:01

Is there a runtime check for an application to find out if it runs as part of an instrumentation test?

Background: Our application performs a database sync when star

8条回答
  •  天涯浪人
    2021-01-04 11:32

    Since API Level 11, the ActivityManager.isRunningInTestHarness() method is available. This might do what you want.

提交回复
热议问题