Search in sources :

Example 1 with MobileLibraryInstallException

use of com.testsigma.agent.exception.MobileLibraryInstallException in project testsigma by testsigmahq.

the class AndroidMobileAutomationServer method installAppiumSettings.

private void installAppiumSettings(IDevice device) throws MobileLibraryInstallException {
    try {
        // if (commandExecutor.isPackageInstalled(device, APPIUM_SETTINGS_PACKAGE)) {
        // log.info("io.appium.settings is already installed. So Skipping the install");
        // return;
        // }
        log.info("Installing AppiumSettings on device" + device.getSerialNumber());
        device.installPackage(appiumSettingAPK().getAbsolutePath(), true);
    } catch (Exception e) {
        throw new MobileLibraryInstallException(e.getMessage(), e);
    }
}
Also used : MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException) MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException)

Example 2 with MobileLibraryInstallException

use of com.testsigma.agent.exception.MobileLibraryInstallException in project testsigma by testsigmahq.

the class AndroidMobileAutomationServer method uninstallAppiumSettings.

private void uninstallAppiumSettings(IDevice device) throws MobileLibraryInstallException {
    try {
        if (!commandExecutor.isPackageInstalled(device, APPIUM_SETTINGS_PACKAGE)) {
            log.info("io.appium.settings is not installed. So Skipping the uninstall");
        }
        log.info("Uninstalling AppiumSettings on device" + device.getSerialNumber());
        device.uninstallPackage(APPIUM_SETTINGS_PACKAGE);
    } catch (Exception e) {
        throw new MobileLibraryInstallException(e.getMessage(), e);
    }
}
Also used : MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException) MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException)

Example 3 with MobileLibraryInstallException

use of com.testsigma.agent.exception.MobileLibraryInstallException in project testsigma by testsigmahq.

the class AndroidMobileAutomationServer method uninstallDrivers.

public void uninstallDrivers(String uniqueId) throws MobileLibraryInstallException {
    try {
        MobileDevice mobileDevice = deviceContainer.getDevice(uniqueId);
        IDevice device = mobileDevice.getIDevice();
        this.uninstallUIAutomatorServer(device);
        this.uninstallUIAutomatorServerTest(device);
        this.uninstallAppiumSettings(device);
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        throw new MobileLibraryInstallException(e.getMessage(), e);
    }
}
Also used : MobileDevice(com.testsigma.agent.mobile.MobileDevice) MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException) IDevice(com.android.ddmlib.IDevice) MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException)

Example 4 with MobileLibraryInstallException

use of com.testsigma.agent.exception.MobileLibraryInstallException in project testsigma by testsigmahq.

the class AndroidMobileAutomationServer method uninstallUIAutomatorServerTest.

private void uninstallUIAutomatorServerTest(IDevice device) throws MobileLibraryInstallException {
    try {
        if (!commandExecutor.isPackageInstalled(device, UI_AUTOMATOR2_TEST_PACKAGE)) {
            log.info("io.appium.uiautomator2.server is not installed. So Skipping the uninstall");
        }
        log.info("Uninstalling UIAutomatorServerTest on device" + device.getSerialNumber());
        device.uninstallPackage(UI_AUTOMATOR2_TEST_PACKAGE);
    } catch (Exception e) {
        throw new MobileLibraryInstallException(e.getMessage(), e);
    }
}
Also used : MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException) MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException)

Example 5 with MobileLibraryInstallException

use of com.testsigma.agent.exception.MobileLibraryInstallException in project testsigma by testsigmahq.

the class AndroidMobileAutomationServer method installUIAutomatorServer.

private void installUIAutomatorServer(IDevice device) throws MobileLibraryInstallException {
    try {
        // if (commandExecutor.isPackageInstalled(device, UI_AUTOMATOR2_PACKAGE)) {
        // log.info("io.appium.uiautomator2.server is already installed. So Skipping the install");
        // return;
        // }
        log.info("Installing UIAutomatorServer on device" + device.getSerialNumber());
        device.installPackage(uiAutomatorServerAPK().getAbsolutePath(), true);
    } catch (Exception e) {
        throw new MobileLibraryInstallException(e.getMessage(), e);
    }
}
Also used : MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException) MobileLibraryInstallException(com.testsigma.agent.exception.MobileLibraryInstallException)

Aggregations

MobileLibraryInstallException (com.testsigma.agent.exception.MobileLibraryInstallException)9 IDevice (com.android.ddmlib.IDevice)2 MobileDevice (com.testsigma.agent.mobile.MobileDevice)2 DeviceNotConnectedException (com.testsigma.agent.exception.DeviceNotConnectedException)1 TestsigmaException (com.testsigma.agent.exception.TestsigmaException)1 TestDeviceSettings (com.testsigma.automator.entity.TestDeviceSettings)1 AutomatorException (com.testsigma.automator.exceptions.AutomatorException)1