How to disable animations in code when running Espresso tests

后端 未结 3 1868
眼角桃花
眼角桃花 2020-12-29 08:54

Has anybody managed to disable animations through code when running Espresso tests? I\'ve been trying to follow the instructions in this webpage (linked to from he

3条回答
  •  感情败类
    2020-12-29 09:28

    I finally got this to work. Here is a Gist listing the required steps:
    https://gist.github.com/daj/7b48f1b8a92abf960e7b

    The key step that I had missed was running adb to grant the permission:

    adb shell pm grant com.mypackage android.permission.SET_ANIMATION_SCALE    
    

    Adding the permission to the manifest and running the reflection steps did not seem to be enough on their own.

提交回复
热议问题