Class AbstractBuilder

    • Constructor Detail

      • AbstractBuilder

        public AbstractBuilder()
    • Method Detail

      • getDeviceIdentifier

        protected static String getDeviceIdentifier​(AbstractBuild<?,​?> build,
                                                    BuildListener listener)
        Gets the Android device identifier for this job, defaulting to the AVD started by this plugin.
        Parameters:
        build - The build for which we should retrieve the SDK instance.
        listener - The listener used to get the environment variables.
        Returns:
        The device identifier (defaulting to the value of "$ANDROID_AVD_DEVICE").
      • getDeviceTelnetPort

        protected static int getDeviceTelnetPort​(AbstractBuild<?,​?> build,
                                                 BuildListener listener)
        Gets the Android device identifier for this job, defaulting to the AVD started by this plugin.
        Parameters:
        build - The build for which we should retrieve the SDK instance.
        listener - The listener used to get the environment variables.
        Returns:
        The device identifier (defaulting to the value of "-s $ANDROID_AVD_DEVICE").
      • waitForCoreProcess

        protected boolean waitForCoreProcess​(AbstractBuild<?,​?> build,
                                             Launcher launcher,
                                             AndroidSdk androidSdk,
                                             String deviceIdentifier)
                                      throws IOException,
                                             InterruptedException
        Waits for the "android.process.acore" process to start, as this is a prerequisite for using the package manager.
        Parameters:
        build -
        launcher -
        androidSdk -
        deviceIdentifier -
        Returns:
        true if the process has started; false if it did not start within a reasonable timeout.
        Throws:
        IOException
        InterruptedException
      • uninstallApk

        protected static boolean uninstallApk​(AbstractBuild<?,​?> build,
                                              Launcher launcher,
                                              PrintStream logger,
                                              AndroidSdk androidSdk,
                                              String deviceIdentifier,
                                              FilePath apkPath)
                                       throws IOException,
                                              InterruptedException
        Uninstalls the Android package corresponding to the given APK file from an Android device.
        Parameters:
        build - The build for which we should uninstall the package.
        launcher - The launcher for the remote node.
        logger - Where log output should be redirected to.
        androidSdk - The Android SDK to use.
        deviceIdentifier - The device from which the package should be removed.
        apkPath - The path to the APK file.
        Returns:
        true iff uninstallation completed successfully.
        Throws:
        IOException - If execution failed.
        InterruptedException - If execution failed.
      • uninstallApk

        protected static boolean uninstallApk​(AbstractBuild<?,​?> build,
                                              Launcher launcher,
                                              PrintStream logger,
                                              AndroidSdk androidSdk,
                                              String deviceIdentifier,
                                              String packageId)
                                       throws IOException,
                                              InterruptedException
        Uninstalls the given Android package ID from the given Android device.
        Parameters:
        build - The build for which we should uninstall the package.
        launcher - The launcher for the remote node.
        logger - Where log output should be redirected to.
        androidSdk - The Android SDK to use.
        deviceIdentifier - The device from which the package should be removed.
        packageId - The ID of the Android package to remove from the given device.
        Returns:
        true iff uninstallation completed successfully.
        Throws:
        IOException - If execution failed.
        InterruptedException - If execution failed.