public abstract class AbstractDevice extends Object implements AndroidDevice
| Modifier and Type | Field and Description |
|---|---|
protected String |
apiTargetType |
protected com.android.ddmlib.IDevice |
device |
protected String |
model |
protected Integer |
port |
protected String |
serial |
static String |
WD_STATUS_ENDPOINT |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDevice() |
|
AbstractDevice(com.android.ddmlib.IDevice device)
Constructor mean to be used with Android Hardware devices because a reference to the
IDevice will be available immediately after they are connected. |
|
AbstractDevice(String serial)
Constructor meant to be used with Android Emulators because a reference to the
IDevice
will become available if the emulator will be started. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearUserData(AndroidApp app) |
boolean |
equals(Object o) |
protected String |
executeCommandQuietly(org.apache.commons.exec.CommandLine command) |
protected String |
executeCommandQuietly(org.apache.commons.exec.CommandLine command,
long timeout) |
protected static String |
extractValue(String regex,
String output) |
void |
forwardPort(int local,
int remote) |
String |
getAPITargetType() |
String |
getCrashLog() |
String |
getExternalStoragePath() |
List<org.openqa.selenium.logging.LogEntry> |
getLogs() |
String |
getModel() |
protected String |
getProp(String key) |
int |
getSelendroidsPort() |
int |
hashCode() |
void |
inputKeyevent(int value)
Use adb to send a keyevent to the device.
|
void |
install(AndroidApp app) |
void |
invokeActivity(String activity) |
boolean |
isDeviceReady() |
boolean |
isInstalled(AndroidApp app) |
boolean |
isInstalled(String appBasePackage) |
boolean |
isLoggingEnabled() |
boolean |
isSelendroidRunning() |
protected boolean |
isSerialConfigured() |
void |
kill(AndroidApp aut) |
String |
listRunningThirdPartyProcesses()
Returns the output of running 'adb shell ps', filtering out system processes.
|
void |
restartADB() |
String |
runAdbCommand(String parameter) |
boolean |
screenSizeMatches(String requestedScreenSize) |
void |
setLoggingEnabled(boolean loggingEnabled) |
void |
setVerbose() |
boolean |
start(AndroidApp app) |
void |
startSelendroid(AndroidApp aut,
int port,
SelendroidCapabilities capabilities) |
byte[] |
takeScreenshot() |
protected byte[] |
toByteArray(BufferedImage image) |
void |
uninstall(AndroidApp app) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetLocale, getScreenSize, getSerial, getTargetPlatform, unlockScreenpublic static final String WD_STATUS_ENDPOINT
protected String serial
protected String model
protected String apiTargetType
protected Integer port
protected com.android.ddmlib.IDevice device
public AbstractDevice(String serial)
IDevice
will become available if the emulator will be started. Please make sure that #setIDevice is
called on the emulator.serial - public AbstractDevice(com.android.ddmlib.IDevice device)
IDevice will be available immediately after they are connected.device - protected AbstractDevice()
protected boolean isSerialConfigured()
public void setVerbose()
setVerbose in interface AndroidDevicepublic boolean isDeviceReady()
isDeviceReady in interface AndroidDevicepublic boolean isInstalled(String appBasePackage) throws AndroidSdkException
isInstalled in interface AndroidDeviceAndroidSdkExceptionpublic boolean isInstalled(AndroidApp app) throws AndroidSdkException
isInstalled in interface AndroidDeviceAndroidSdkExceptionpublic void install(AndroidApp app) throws AndroidSdkException
install in interface AndroidDeviceAndroidSdkExceptionpublic boolean start(AndroidApp app) throws AndroidSdkException
start in interface AndroidDeviceAndroidSdkExceptionprotected String executeCommandQuietly(org.apache.commons.exec.CommandLine command)
protected String executeCommandQuietly(org.apache.commons.exec.CommandLine command, long timeout)
public void uninstall(AndroidApp app) throws AndroidSdkException
uninstall in interface AndroidDeviceAndroidSdkExceptionpublic void clearUserData(AndroidApp app) throws AndroidSdkException
clearUserData in interface AndroidDeviceAndroidSdkExceptionpublic void kill(AndroidApp aut) throws AndroidDeviceException, AndroidSdkException
kill in interface AndroidDeviceAndroidDeviceExceptionAndroidSdkExceptionpublic void startSelendroid(AndroidApp aut, int port, SelendroidCapabilities capabilities) throws AndroidSdkException
startSelendroid in interface AndroidDeviceAndroidSdkExceptionpublic void forwardPort(int local,
int remote)
forwardPort in interface AndroidDevicepublic boolean isSelendroidRunning()
isSelendroidRunning in interface AndroidDevicepublic int getSelendroidsPort()
getSelendroidsPort in interface AndroidDevicepublic List<org.openqa.selenium.logging.LogEntry> getLogs()
getLogs in interface AndroidDevicepublic boolean isLoggingEnabled()
isLoggingEnabled in interface AndroidDevicepublic void setLoggingEnabled(boolean loggingEnabled)
setLoggingEnabled in interface AndroidDevicepublic boolean screenSizeMatches(String requestedScreenSize)
screenSizeMatches in interface AndroidDevicepublic String runAdbCommand(String parameter)
runAdbCommand in interface AndroidDevicepublic byte[] takeScreenshot()
throws AndroidDeviceException
takeScreenshot in interface AndroidDeviceAndroidDeviceExceptionprotected byte[] toByteArray(BufferedImage image) throws AndroidDeviceException
AndroidDeviceExceptionpublic void inputKeyevent(int value)
inputKeyevent in interface AndroidDevicevalue - - Key to be sent to 'adb shell input keyevent'public void invokeActivity(String activity)
invokeActivity in interface AndroidDevicepublic void restartADB()
restartADB in interface AndroidDevicepublic String getExternalStoragePath()
getExternalStoragePath in interface AndroidDevicepublic String getCrashLog()
getCrashLog in interface AndroidDevicepublic String listRunningThirdPartyProcesses()
listRunningThirdPartyProcesses in interface AndroidDevicepublic String getModel()
getModel in interface AndroidDevicepublic String getAPITargetType()
getAPITargetType in interface AndroidDeviceCopyright © 2015. All rights reserved.