All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.appium.manager.AppiumDeviceManager Maven / Gradle / Ivy

There is a newer version: 9.0.1
Show newest version
package com.appium.manager;

import com.appium.capabilities.DriverSession;
import com.appium.entities.MobilePlatform;
import com.appium.plugin.PluginClI;

import java.io.IOException;

/**
 * Device Manager - Handles all device related information's e.g UDID, Model, etc
 */
public class AppiumDeviceManager {

    private static ThreadLocal appiumDevice = new ThreadLocal<>();


    public static DriverSession getAppiumDevice() {
        return appiumDevice.get();
    }

    protected static void setDevice(DriverSession device) {
        appiumDevice.set(device);
    }


    public static MobilePlatform getMobilePlatform() {
        return MobilePlatform.valueOf(PluginClI.getInstance().getPlatFormName().toUpperCase());
    }

    public static boolean isPlatform(MobilePlatform expectedPlatform) throws IOException {
        return AppiumDeviceManager.getMobilePlatform().equals(expectedPlatform);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy