Uiautomator “am start”

后端 未结 3 796
一个人的身影
一个人的身影 2021-01-03 02:47

Does any body know how to call
am start -a ACTIVITY from uiautomator code.
Or is it possible to start activity right from junit

3条回答
  •  无人及你
    2021-01-03 03:29

    What I have done, is make the starting the app and running your UIAutomator tests part of the build. This is how I get my UIAutomator test to run after I build the Ant build.xml. This snippet is added to the end of the build.xml and causes your application to start, then starts your UI tests. Using eclipse make sure you go to right-click build.xml then -> Run As -> Ant Build... and make sure the correct targets are selected: 'build', 'install', 'start', 'mytest'. Targets 'start' and 'mytest' are added by following snippet.

    
    
    
    
    
        Starting Navigation Example
    
        
            
            
            
            
            
        
    
    
    
        Running UI Tests
        
           
           
           
           
           
           
       
    
    

提交回复
热议问题