public class MobileEngine.Device extends Object
| Constructor and Description |
|---|
Device() |
| Modifier and Type | Method and Description |
|---|---|
void |
copyFileFrom(String deviceFilePath,
String localFilePath)
Copies file from device to local machine
|
void |
copyFileTo(String localFilePath,
String deviceFilePath)
Copies file to device
|
void |
createDirectory(String directoryPath)
Creates directory on mobile device
|
void |
deleteDirectory(String directoryPath,
boolean recursively)
Deletes a directory from the mobile device
|
void |
deleteFile(String filePath)
Deletes a file from the mobile device
|
String |
getMD5Sum(String filePath)
Calculate file MD5 sum directly on the mobile device
|
void |
installApp(String appPath) |
boolean |
isAppInstalled(String appName) |
FileInfo[] |
listFiles(String path)
List files and directories on the mobile device
|
void |
pressHWButtonBack() |
void |
pressHWButtonHome() |
void |
removeApp(String appName) |
void |
resetApp() |
void |
runAppInBackground(int seconds)
Runs the current app as a background app for the number of seconds
requested.
|
void |
runAppInBackground(int seconds,
String appName)
Runs the current app as a background app for the number of seconds
requested.
|
public void installApp(String appPath)
appPath - application absolute path
NOTE: 'adb' executable must be in the $PATH variable in the environment of the Appium serverpublic boolean isAppInstalled(String appName)
appName - public void removeApp(String appName)
appName - public void resetApp()
public void pressHWButtonBack()
public void pressHWButtonHome()
public void runAppInBackground(int seconds)
seconds - number of seconds to run App in backgroundpublic void runAppInBackground(int seconds,
String appName)
seconds - number of seconds to run App in backgroundappName - public String getMD5Sum(String filePath)
filePath - file absolute path
public FileInfo[] listFiles(String path)
path - a path on the mobile device. It can be a directory or file (if you want to check
for specific file existence)
FileInfo array with all the files and folders from the target pathpublic void deleteDirectory(String directoryPath, boolean recursively)
directoryPath - the directory for deletionrecursively - whether to delete the internal directories recursively
Note for iOS: You can specify relative directory path too, by skipping the root slash '/' at the beginning
and pass the path relative to the application data folderpublic void deleteFile(String filePath)
filePath - the file for deletion
Note for iOS: You can specify relative file path too, by skipping the root slash '/' at the beginning
and pass the path relative to the application data folderpublic void createDirectory(String directoryPath)
directoryPath - the directory for creationpublic void copyFileTo(String localFilePath, String deviceFilePath)
localFilePath - local file pathdeviceFilePath - file path on the deviceCopyright © 2017 Axway Software. All rights reserved.