Package com :: Package dtmilano :: Package android :: Package adb :: Module adbclient :: Class AdbClient |
[hide private]
[frames] | no frames]

# Class AdbClient

source code

Nested Classes | [hide private]
| __Log Log class to simulate `android.util.Log`

Instance Methods | [hide private]
__init__(self, serialno=None, hostname=`'``localhost``'`, port=5037, settransport=True, reconnect=True, ignoreversioncheck=False, timeout=15) | source code
__timeoutHandler(self, timerId) | source code
setTimer(self, timeout) | source code
cancelTimer(self, timerId) | source code
setSerialno(self, serialno) | source code
setReconnect(self, val) | source code
close(self) | source code
__del__(self) | source code
__send(self, msg, checkok=True, reconnect=False) | source code
__receive(self, nob=None, sock=None) | source code
__checkOk(self, sock=None) | source code
checkConnected(self, sock=None) | source code
checkVersion(self, ignoreversioncheck=False, reconnect=True) | source code
__setTransport(self, timeout=60) | source code
__checkTransport(self) | source code
__readExactly(self, sock, size) | source code
getDevices(self) | source code
shell(self, cmd=None) | source code
getRestrictedScreen(self) Gets `mRestrictedScreen` values from dumpsys. | source code
getDisplayInfo(self) | source code
getLogicalDisplayInfo(self) Gets `mDefaultViewport` and then `deviceWidth` and `deviceHeight` values from dumpsys. | source code
getPhysicalDisplayInfo(self) Gets `mPhysicalDisplayInfo` values from dumpsys. | source code
__getProp(self, key, strip=True) | source code
__getDisplayWidth(self, key, strip=True) | source code
__getDisplayHeight(self, key, strip=True) | source code
__getDisplayOrientation(self, key, strip=True) | source code
__getDisplayDensity(self, key, strip=True, invokeGetPhysicalDisplayIfNotFound=True) | source code
getSystemProperty(self, key, strip=True) | source code
getProperty(self, key, strip=True) Gets the property value for key | source code
getSdkVersion(self) Gets the SDK version. | source code
press(self, name, eventType=2) | source code
longPress(self, name, duration=0.5, dev=`'``/dev/input/event0``'`, scancode=0, repeat=1) | source code
startActivity(self, component=None, flags=None, uri=None) | source code
takeSnapshot(self, reconnect=False) Takes a snapshot of the device and return it as a PIL Image. | source code
__transformPointByOrientation(self, (x, y), orientationOrig, orientationDest) | source code
touch(self, x, y, orientation=-1, eventType=2) | source code
touchDip(self, x, y, orientation=-1, eventType=2) | source code
longTouch(self, x, y, duration=2000, orientation=-1) Long touches at (x, y) | source code
drag(self, (x0, y0), (x1, y1), duration, steps=1, orientation=-1) Sends drag event in PX (actually it's using `input swipe` command). | source code
dragDip(self, (x0, y0), (x1, y1), duration, steps=1, orientation=-1) Sends drag event in DIP (actually it's using `input swipe` command. | source code
type(self, text) | source code
wake(self) | source code
isLocked(self) Checks if the device screen is locked. | source code
isScreenOn(self) Checks if the screen is ON. | source code
unlock(self) Unlocks the screen of the device. | source code
isKeyboardShown(self) Whether the keyboard is displayed. | source code
initDisplayProperties(self) | source code
log(self, tag, message, priority=`'``D``'`, verbose=False) | source code
getSystemService(self, name) | source code
getWindows(self) | source code
getFocusedWindow(self) Gets the focused window. | source code
getFocusedWindowName(self) Gets the focused window name. | source code
getTopActivityNameAndPid(self) | source code
getTopActivityName(self) | source code
substituteDeviceTemplate(self, template) | source code
dumpsys(self, subcommand, args) | source code

Static Methods | [hide private]
connect(hostname, port, timeout=15) | source code
percentSame(image1, image2) Returns the percent of pixels that are equal | source code
sameAs(image1, image2, percent=1.0) Compares 2 images | source code
imageInScreen(screen, image) Checks if image is on the screen | source code
compare(image1, image2, imageResult) | source code

Class Variables | [hide private]
| UP = `0`
| DOWN = `1`
| DOWN_AND_UP = `2`

Instance Variables | [hide private]
| build Build properties
| __displayInfo Cached display info.
| display The map containing the device's physical display properties: width, height and density

Method Details | [hide private]

### getRestrictedScreen(self) | source code
Gets `mRestrictedScreen` values from dumpsys. This is a method to obtain display dimensions

### getLogicalDisplayInfo(self) | source code
Gets `mDefaultViewport` and then `deviceWidth` and `deviceHeight` values from dumpsys. This is a method to obtain display logical dimensions and density

### getPhysicalDisplayInfo(self) | source code
Gets `mPhysicalDisplayInfo` values from dumpsys. This is a method to obtain display dimensions and density

### longTouch(self, x, y, duration=2000, orientation=-1) | source code
Long touches at (x, y) Parameters: `duration` - duration in ms `orientation` - the orientation (-1: undefined) This workaround was suggested by HaMi

### drag(self, (x0, y0), (x1, y1), duration, steps=1, orientation=-1) | source code
Sends drag event in PX (actually it's using `input swipe` command). Parameters: `(x0`, `y0)` - starting point in PX `(x1`, `y1)` - ending point in PX `duration` - duration of the event in ms `steps` - number of steps (currently ignored by @{input swipe}) `orientation` - the orientation (-1: undefined)

### dragDip(self, (x0, y0), (x1, y1), duration, steps=1, orientation=-1) | source code
Sends drag event in DIP (actually it's using `input swipe` command. Parameters: `(x0`, `y0)` - starting point in DIP `(x1`, `y1)` - ending point in DIP `duration` - duration of the event in ms `steps` - number of steps (currently ignored by @{input swipe}

### isLocked(self) | source code
Checks if the device screen is locked. @return True if the device screen is locked

### isScreenOn(self) | source code
Checks if the screen is ON. @return True if the device screen is ON

### percentSame(image1, image2) Static Method | source code
Returns the percent of pixels that are equal Author: catshoes

### sameAs(image1, image2, percent=1.0) Static Method | source code
Compares 2 images Author: catshoes

### imageInScreen(screen, image) Static Method | source code
Checks if image is on the screen :param screen: the screen image :param image: the partial image to look for :return: True or False Author: Perry Tsai <ripple0129@gmail.com>

### getFocusedWindow(self) | source code
Gets the focused window. Returns: The focused Window.

### getFocusedWindowName(self) | source code
Gets the focused window name. This is much like monkeyRunner's `HierarchyView.getWindowName()` Returns: The focused window name

Instance Variable Details | [hide private]

### __displayInfo Cached display info. Reset it to `None` to force refetching display info