Package 

Interface AdbServer


  • 
    public interface AdbServer
    
                        

    This is a comfortable wrapper to work with AdbServer repository.

    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"

    Important notes:

    • Real connection is established only after a call one of methods of the interface except disconnectServer(). So it's lazy wrapper. Keep it in your mind when you decide to put custom implementation od AdbServer.

    • Kaspresso calls disconnectServer() after each test if the connection was established during the test.

    • Method Summary

      Modifier and Type Method Description
      abstract List<String> performCmd(Array<Out String> commands) Executes shell commands blocking current thread.
      abstract List<String> performAdb(Array<Out String> commands) Performs adb commands blocking current thread.
      abstract List<String> performShell(Array<Out String> commands) Performs shell commands blocking current thread.
      abstract Unit disconnectServer() Disconnect from AdbServer.
      • Methods inherited from class com.kaspersky.kaspresso.device.server.AdbServer

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • performCmd

         abstract List<String> performCmd(Array<Out String> commands)

        Executes shell commands blocking current thread. Please be aware! If any command that is in @param commands failed then AdbServerException will be thrown

        Required Permissions: INTERNET.

        Parameters:
        commands - commands to execute.
      • performAdb

         abstract List<String> performAdb(Array<Out String> commands)

        Performs adb commands blocking current thread. Please be aware! If any command that is in @param commands failed then AdbServerException will be thrown

        Required Permissions: INTERNET.

        Parameters:
        commands - commands to execute.
      • performShell

         abstract List<String> performShell(Array<Out String> commands)

        Performs shell commands blocking current thread. Please be aware! If any command that is in @param commands failed then AdbServerException will be thrown

        Required Permissions: INTERNET.

        Parameters:
        commands - commands to execute.
      • disconnectServer

         abstract Unit disconnectServer()

        Disconnect from AdbServer. The method is called by Kaspresso after each test.