public boolean handlePopBox ( String deviceBrand ) { pushHandleGps2Device ( ) ; CommandLine exeCommand = null ; if ( deviceBrand . contains ( "HTC" ) ) { exeCommand = adbCommand ( "shell" , "uiautomator" , "runtest" , "/data/local/tmp/handlePopBox.jar" , "-c" , "com.test.device.gps.HTCGPSTest" ) ; } else if ( deviceBrand . contains ( "Meizu" ) ) { exeCommand = adbCommand ( "shell" , "uiautomator" , "runtest" , "/data/local/tmp/handlePopBox.jar" , "-c" , "com.test.device.gps.MeizuGPSTest" ) ; } String output = executeCommandQuietly ( exeCommand ) ; log . debug ( "run test {}" , output ) ; try { // give it a second to recover from the activity start Thread . sleep ( 1000 ) ; } catch ( InterruptedException ie ) { throw new RuntimeException ( ie ) ; } return output . contains ( "OK" ) ; }
try to click GPS Popup window