Android :java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission

前端 未结 9 1467
感动是毒
感动是毒 2020-12-01 11:48

Hi there I am new to Android Junit testing:

I have written some test code in MainActivityFunctionalTest.java file

MainActivityFunctionalTest.java:

         


        
9条回答
  •  醉酒成梦
    2020-12-01 12:37

    for a rooted device, this file helped me a lot. It has:

     Injector.pressBackButton();
     Injector.pressHomeButton();
     Injector.pressPowerButton();
     Injector.showNotificationCenter();
     Injector.swipeLeftRight();
     Injector.swipeRightLeft();
     Injector.touch(x, y);
    

提交回复
热议问题