Package 

Interface Apps


  • 
    public interface Apps
    
                        

    The 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 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.
      • 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.