????monkeyrunner?????????????飺
????1??MonkeyRunner???????????????????monkeyrunner???豸????????????????????????????????????????????????
????2??MonkeyDevice??????????豸????????????????????ж?????????Activity??????????????????????в???????????????
????3??MonkeyImage????????????????????????????????????λ????????????????????MonkeyImage??????image???浽??????????????
????device=MonkeyRunner.waitForConnection()
????#?????????豸??????????????????monkeydevice??????????????豸????б????????????????
????????1??????????λ??????????????????????????
????????2????deviceid????????豸?????????????豸????????????????????USB???????PC???????????????
????????????device=MonkeyRunner.waitForConnection()
?????????????device=MonkeyRunner.waitForConnection(1.0?? 'emulator-5554‘??
???????????г????????????????
????MonkeyRunner.sleep(????????????)
?????????????
????result=device.takeSnapshot()
????result.writeToFile("D:/result.png"??'png')
????MonkeyImage.writeToFile(????1????????????????????·????????2???????)
????д???????true????????false
??????????????????????
????device.press(????1?????? ????2:???????????)
????????1?????ü?????
????????HOME?? device.press('KEYCODE_HOME'?? MonkeyDevice.DOWN_AND_UP)
????????BACK?? device.press('KEYCODE_BACK'?? MonkeyDevice.DOWN_AND_UP)
?????????μ????? device.press('KEYCODE_DPAD_DOWN'?? MonkeyDevice.DOWN_AND_UP)
??????????????? device.press('KEYCODE_DPAD_UP'?? MonkeyDevice.DOWN_AND_UP)
????????OK?? device.press('KEYCODE_DPAD_CENTER'?? MonkeyDevice.DOWN_AND_UP)
?????????????? device.press('KEYCODE_DPAD_LEFT'?? MonkeyDevice.DOWN_AND_UP)
??????????????? device.press('KEYCODE_DPAD_RIGHT'?? MonkeyDevice.DOWN_AND_UP)
????????????????????
????menu????KEYCODE_MENU
????home????KEYCODE_HOME
????back????KEYCODE_BACK
????search????KEYCODE_SEARCH
????call????KEYCODE_CALL
????end????KEYCODE_ENDCALL
??????????????KEYCODE_VOLUME_UP
??????????????KEYCODE_VOLUME_DOWN
????power????KEYCODE_POWER
????camera????KEYCODE_CAMERA