-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustpush.py
31 lines (24 loc) · 933 Bytes
/
justpush.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python
# -*- coding: latin-1 -*-
# Imports the monkeyrunner modules used by this program
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
#import time
# Connects to the current device, returning a MonkeyDevice object
# timeout = 10000
# device = MonkeyRunner.waitForConnection(timeout, emulator_name)
#to list name of device: >adb devices
deviceid = 'emulator-5554'
device = MonkeyRunner.waitForConnection(10,deviceid)
#import os
#devices = os.popen('adb devices').read().strip().split('\n')[1:];
#deviceid = devices[0].split('\t')[0];
#device = MonkeyRunner.waitForConnection('',deviceid)
#MonkeyRunner.sleep(1)
#Touch the new status button
device.touch(200, 300, MonkeyDevice.DOWN)
#TODO MonkeyImage.getRawPixel(200,300)
# Wait for few seconds
#MonkeyRunner.sleep(120)
#device.touch(200, 300, MonkeyDevice.UP)
# Wait for few seconds
#MonkeyRunner.sleep(5)