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
|
ActivityManager |
getActivityManager() |
boolean |
getAlreadyRuns() |
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.
|
String |
getProperty(String name)
Returns a value of property with given name
|
Screenshot |
getScreenshot() |
String |
getSerialNumber()
Returns serial number of device.
|
void |
installPackage(File packageFilePath,
boolean reinstall,
String... extraArgs)
Installs an Android application on device.
|
void |
installPackage(String 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. |
boolean |
isRecording()
Checks if this Android device records some video.
|
void |
pull(File remoteFile,
File localFile)
Pulls file from mobile phone to computer.
|
void |
pull(String remoteFilePath,
String localFilePath)
Pulls file from mobile phone to computer.
|
void |
push(File localFile,
File remoteFile)
Pushes file from computer to mobile phone.
|
void |
push(String localFilePath,
String remoteFilePath)
Pushes file from computer to mobile phone.
|
void |
remove(File remoteFile)
Removes file on Android device.
|
void |
remove(String remoteFilePath)
Removes file on Android device.
|
void |
removePortForwarding(int localPort,
int remotePort)
Removes a port forwarding between a local and a remote port.
|
void |
setActivityManager(ActivityManager activityManager) |
void |
setAlreadyRuns(boolean alreadyRuns) |
void |
setDroneGuestPort(int droneGuestPort)
Guest port is port on the Android device side
|
void |
setDroneHostPort(int droneHostPort)
Host is your local computer
|
void |
startRecording(File remoteFilePath,
ScreenrecordOptions options)
Starts video recording.
|
void |
startRecording(ScreenrecordOptions options)
Starts video recording.
|
void |
startRecording(String remoteFilePath,
ScreenrecordOptions options)
Starts video recording.
|
Video |
stopRecording(File localFilePath)
Stops Android device from recording a video.
|
Video |
stopRecording(String localFilePath)
Stops Android device from recording a video.
|
void |
uninstallPackage(String packageName)
Uninstalls an package from the device.
|
String getSerialNumber()
String getAvdName()
null if device is not an emulatorString 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 installPackage(String 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() throws Exception
Exceptionvoid setActivityManager(ActivityManager activityManager)
activityManager - ActivityManager getActivityManager()
void setAlreadyRuns(boolean alreadyRuns)
alreadyRuns - true if Android device already runs, false otherwiseboolean getAlreadyRuns()
void pull(String remoteFilePath, String localFilePath) throws Exception
remoteFilePath - remote file to pulllocalFilePath - local file to save pulled file toExceptionvoid pull(File remoteFile, File localFile) throws Exception
remoteFile - remote file to pulllocalFile - local file to save pulled file toExceptionvoid push(String localFilePath, String remoteFilePath) throws Exception
localFilePath - local file to pushremoteFilePath - remote file to save pushed file toExceptionvoid push(File localFile, File remoteFile) throws Exception
localFile - local file to pushremoteFile - remote file to save pushed file toExceptionvoid remove(String remoteFilePath) throws Exception
remoteFilePath - file path to removeExceptionvoid remove(File remoteFile) throws Exception
remoteFile - file to removeExceptionvoid startRecording(String remoteFilePath, ScreenrecordOptions options) throws Exception
remoteFilePath - path on mobile phone to save the recorded video tooptions - Exceptionvoid startRecording(File remoteFilePath, ScreenrecordOptions options) throws Exception
remoteFilePath - path on mobile phone to save the recorded video tooptions - Exceptionvoid startRecording(ScreenrecordOptions options) throws Exception
/sdcard on a mobile phone.options - Exceptionboolean isRecording()
Video stopRecording(String localFilePath) throws Exception
localFilePath - path on computer host where to save recorded file by startRecording(ScreenrecordOptions)ExceptionVideo stopRecording(File localFilePath) throws Exception
localFilePath - path on computer host where to save recorded file by startRecording(ScreenrecordOptions)ExceptionCopyright © 2015 JBoss by Red Hat. All rights reserved.