
public interface AndroidDevice
| Modifier and Type | Method and Description |
|---|---|
void |
createPortForwarding(int localPort,
int remotePort)
Creates a port forwarding between a local and a remote port.
|
void |
executeShellCommand(String command)
Executes a shell command on the device.
|
void |
executeShellCommand(String command,
AndroidDeviceOutputReciever reciever)
Executes a shell command on the device
|
ActivityManagerProvider |
getActivityManagerProvider() |
String |
getAvdName()
Returns name of Android Virtual Device.
|
String |
getConsolePort() |
int |
getDroneGuestPort()
Guest port is port on the Android device side
|
int |
getDroneHostPort()
Host is your local computer.
|
Map<String,String> |
getProperties()
Returns a map of properties available for the device.
|
String |
getProperty(String name)
Returns a value of property with given name
|
Screenshot |
getScreenshot()
Gets a screenshot of underlying Android device.
|
String |
getSerialNumber()
Returns serial number of device.
|
void |
installPackage(File packageFilePath,
boolean reinstall,
String... extraArgs)
Installs an Android application on device.
|
boolean |
isEmulator()
Checks if the device is an emulator
|
boolean |
isOffline()
Checks if the device is offline.
|
boolean |
isOnline()
Checks if the device is online
|
boolean |
isPackageInstalled(String packageName)
Checks if an APK package of name
packageName is installed or not. |
void |
removePortForwarding(int localPort,
int remotePort)
Removes a port forwarding between a local and a remote port.
|
void |
setActivityManagerProvider(ActivityManagerProvider activityManagerProvider) |
void |
setDroneGuestPort(int droneGuestPort)
Guest port is port on the Android device side
|
void |
setDroneHostPort(int droneHostPort)
Host is your local computer
|
void |
uninstallPackage(String packageName)
Uninstalls an package from the device.
|
String getSerialNumber()
String getAvdName()
null if device is not an emulatorMap<String,String> getProperties()
String getProperty(String name) throws IOException, AndroidExecutionException
name - A keynull if not presentIOExceptionAndroidExecutionExceptionboolean isOnline()
true if device is online, false otherwiseboolean isEmulator()
true if device is an emulator, false otherwiseboolean isOffline()
true if device is offline, false otherwisevoid executeShellCommand(String command) throws AndroidExecutionException
command - The command to be executedAndroidExecutionExceptionvoid executeShellCommand(String command, AndroidDeviceOutputReciever reciever) throws AndroidExecutionException
command - The command to be executedreciever - A processor to process command outputAndroidExecutionExceptionvoid createPortForwarding(int localPort,
int remotePort)
throws AndroidExecutionException
localPort - the local port to forwardremotePort - the remote port.AndroidExecutionExceptionvoid removePortForwarding(int localPort,
int remotePort)
throws AndroidExecutionException
localPort - the local port to forwardremotePort - the remote port.AndroidExecutionExceptionvoid installPackage(File packageFilePath, boolean reinstall, String... extraArgs) throws AndroidExecutionException
packageFilePath - the absolute file system path to file on local host to installreinstall - set to trueif re-install of app should be performedextraArgs - optional extra arguments to pass. See 'adb shell pm install --help' for available options.AndroidExecutionExceptionvoid uninstallPackage(String packageName) throws AndroidExecutionException
packageName - the Android application package name to uninstallAndroidExecutionExceptionboolean isPackageInstalled(String packageName) throws AndroidExecutionException
packageName is installed or not.packageName - name of the installed packagepackageName is installed, false otherwiseAndroidExecutionExceptionString getConsolePort()
adb devices -l command.int getDroneHostPort()
int getDroneGuestPort()
void setDroneHostPort(int droneHostPort)
droneHostPort - for extensions like Droidium native or web pluginvoid setDroneGuestPort(int droneGuestPort)
droneGuestPort - for extensions like Droidium native or web pluginScreenshot getScreenshot()
void setActivityManagerProvider(ActivityManagerProvider activityManagerProvider)
activityManagerProvider - ActivityManagerProvider getActivityManagerProvider()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.