-
public interface AppsThe interface to work with installer, launcher and package manager.
Required: Started AdbServer 1. Download a file "kaspresso/artifacts/adbserver-desktop.jar" 2. Start AdbServer => input in cmd "java jar path_to_file/adbserver-desktop.jar" Methods demanding to use AdbServer in the default implementation of this interface are marked. But nobody can't deprecate you to write implementation that doesn't require AdbServer.
-
-
Method Summary
Modifier and Type Method Description abstract Unitinstall(String apkPath)Installs an app via ADB. abstract UnitinstallIfNotExists(String packageName, String apkPath)Installs an app via ADB only if packageName is not installedRequired Permissions: INTERNET. abstract Unituninstall(String packageName)Uninstalls an app via ADB. abstract UnituninstallIfExists(String packageName)Uninstalls an app via ADB only if it installedRequired Permissions: INTERNET. abstract BooleanisInstalled(String packageName)Checks app is installed on device abstract UnitwaitForLauncher(Long timeout, String launcherPackageName)abstract UnitwaitForAppLaunchAndReady(Long timeout, String packageName)abstract UnitopenUrlInChrome(String url)Opens the given url on Chrome. abstract Unitlaunch(String packageName, Uri data)Launches an app with given packageName. abstract UnitopenRecent(String contentDescription)Opens the app from the recent list by the description. abstract Unitkill(String packageName)Kills the process of the app by the given packageName. abstract StringgetTargetAppLauncherPackageName()abstract StringgetTargetAppPackageName()-
-
Method Detail
-
install
abstract Unit install(String apkPath)
Installs an app via ADB.
Required Permissions: INTERNET.
- Parameters:
apkPath- a path to the apk to be installed.
-
installIfNotExists
abstract Unit installIfNotExists(String packageName, String apkPath)
Installs an app via ADB only if packageName is not installed
Required Permissions: INTERNET.
- Parameters:
packageName- an android package name of the app to be checked.apkPath- a path to the apk to be installed.
-
uninstall
abstract Unit uninstall(String packageName)
Uninstalls an app via ADB.
Required Permissions: INTERNET.
- Parameters:
packageName- an android package name of the app to be deleted.
-
uninstallIfExists
abstract Unit uninstallIfExists(String packageName)
Uninstalls an app via ADB only if it installed
Required Permissions: INTERNET.
- Parameters:
packageName- an android package name of an app to be deleted.
-
isInstalled
abstract Boolean isInstalled(String packageName)
Checks app is installed on device
- Parameters:
packageName- an android package name of the app to be checked.
-
waitForLauncher
abstract Unit waitForLauncher(Long timeout, String launcherPackageName)
-
waitForAppLaunchAndReady
abstract Unit waitForAppLaunchAndReady(Long timeout, String packageName)
-
openUrlInChrome
abstract Unit openUrlInChrome(String url)
Opens the given url on Chrome.
- Parameters:
url- the url to be opened.
-
launch
abstract Unit launch(String packageName, Uri data)
Launches an app with given packageName.
- Parameters:
packageName- the package name of an app to launch.data- the data to put to the launch intent.
-
openRecent
abstract Unit openRecent(String contentDescription)
Opens the app from the recent list by the description.
- Parameters:
contentDescription- the description of the app to launch.
-
kill
abstract Unit kill(String packageName)
Kills the process of the app by the given packageName.
- Parameters:
packageName- the package name of the app to be killed.
-
getTargetAppLauncherPackageName
abstract String getTargetAppLauncherPackageName()
-
getTargetAppPackageName
abstract String getTargetAppPackageName()
-
-
-
-